diff options
Diffstat (limited to 'mesa/main')
-rw-r--r-- | mesa/main/arrayobj.h | 79 | ||||
-rw-r--r-- | mesa/main/bufferobj.h | 5 | ||||
-rw-r--r-- | mesa/main/colormac.h | 9 | ||||
-rw-r--r-- | mesa/main/compiler.h | 482 | ||||
-rw-r--r-- | mesa/main/config.h | 32 | ||||
-rw-r--r-- | mesa/main/context.h | 14 | ||||
-rw-r--r-- | mesa/main/dd.h | 43 | ||||
-rw-r--r-- | mesa/main/enums.h | 6 | ||||
-rw-r--r-- | mesa/main/fbobject.h | 5 | ||||
-rw-r--r-- | mesa/main/framebuffer.h | 3 | ||||
-rw-r--r-- | mesa/main/glheader.h | 256 | ||||
-rw-r--r-- | mesa/main/image.h | 7 | ||||
-rw-r--r-- | mesa/main/imports.h | 189 | ||||
-rw-r--r-- | mesa/main/macros.h | 37 | ||||
-rw-r--r-- | mesa/main/matrix.h | 25 | ||||
-rw-r--r-- | mesa/main/mfeatures.h | 3 | ||||
-rw-r--r-- | mesa/main/mtypes.h | 792 | ||||
-rw-r--r-- | mesa/main/polygon.h (renamed from mesa/main/depthstencil.h) | 50 | ||||
-rw-r--r-- | mesa/main/state.h | 14 | ||||
-rw-r--r-- | mesa/main/texenv.h | 11 | ||||
-rw-r--r-- | mesa/main/texformat.h | 39 | ||||
-rw-r--r-- | mesa/main/texgetimage.h | 46 | ||||
-rw-r--r-- | mesa/main/texobj.h | 3 | ||||
-rw-r--r-- | mesa/main/texstore.h | 18 | ||||
-rw-r--r-- | mesa/main/varray.h | 14 | ||||
-rw-r--r-- | mesa/main/viewport.h | 52 |
26 files changed, 1256 insertions, 978 deletions
diff --git a/mesa/main/arrayobj.h b/mesa/main/arrayobj.h new file mode 100644 index 0000000..9c4036a --- /dev/null +++ b/mesa/main/arrayobj.h @@ -0,0 +1,79 @@ +/* + * 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 <idr@us.ibm.com> + * \author Brian Paul + */ + +/* + * Internal functions + */ + +extern struct gl_array_object * +_mesa_new_array_object( GLcontext *ctx, GLuint name ); + +extern void +_mesa_delete_array_object( GLcontext *ctx, struct gl_array_object *obj ); + +extern void +_mesa_reference_array_object(GLcontext *ctx, + struct gl_array_object **ptr, + struct gl_array_object *arrayObj); + +extern void +_mesa_initialize_array_object( GLcontext *ctx, + struct gl_array_object *obj, GLuint name ); + +extern void +_mesa_save_array_object( GLcontext *ctx, struct gl_array_object *obj ); + +extern 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/mesa/main/bufferobj.h b/mesa/main/bufferobj.h index 163fe24..3c08f00 100644 --- a/mesa/main/bufferobj.h +++ b/mesa/main/bufferobj.h @@ -103,9 +103,8 @@ _mesa_map_drawpix_pbo(GLcontext *ctx, const GLvoid *pixels); extern void -_mesa_unmap_drapix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack); - +_mesa_unmap_drawpix_pbo(GLcontext *ctx, + const struct gl_pixelstore_attrib *unpack); extern void * _mesa_map_readpix_pbo(GLcontext *ctx, diff --git a/mesa/main/colormac.h b/mesa/main/colormac.h index 74692e9..815624e 100644 --- a/mesa/main/colormac.h +++ b/mesa/main/colormac.h @@ -71,9 +71,6 @@ /** \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)) @@ -91,8 +88,6 @@ #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)) @@ -110,8 +105,6 @@ #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 */ @@ -130,8 +123,6 @@ #define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC) -#define CHAN_PRODUCT(a, b) ((a) * (b)) - #else #error unexpected CHAN_BITS size diff --git a/mesa/main/compiler.h b/mesa/main/compiler.h new file mode 100644 index 0000000..e79bbc2 --- /dev/null +++ b/mesa/main/compiler.h @@ -0,0 +1,482 @@ +/* + * 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 compiler.h + * Compiler-related stuff. + */ + + +#ifndef COMPILER_H +#define COMPILER_H + + +#include <assert.h> +#include <ctype.h> +#if defined(__alpha__) && defined(CCPML) +#include <cpml.h> /* use Compaq's Fast Math Library on Alpha */ +#else +#include <math.h> +#endif +#include <limits.h> +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#if defined(__linux__) && defined(__i386__) +#include <fpu_control.h> +#endif +#include <float.h> +#include <stdarg.h> + + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * Get standard integer types + */ +#if defined(_MSC_VER) + typedef __int8 int8_t; + typedef unsigned __int8 uint8_t; + typedef __int16 int16_t; + typedef unsigned __int16 uint16_t; +# ifndef __eglplatform_h_ + typedef __int32 int32_t; +# endif + typedef unsigned __int32 uint32_t; + typedef __int64 int64_t; + typedef unsigned __int64 uint64_t; + +# if defined(_WIN64) + typedef __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +# else + typedef __int32 intptr_t; + typedef unsigned __int32 uintptr_t; +# endif + +# define INT64_C(__val) __val##i64 +# define UINT64_C(__val) __val##ui64 +#else +# include <stdint.h> +#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 + + +/** + * finite macro. + */ +#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 + + +/** + * Disable assorted warnings + */ +#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 +#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 + + +/** + * PUBLIC/USED macros + * + * 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. In those places use + * CONST instead of const. Pass -DNO_CONST to compilers where this matters. + */ +#ifdef NO_CONST +# define CONST +#else +# define CONST const +#endif + + +/** + * __builtin_expect macros + */ +#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__ "<unknown>" +# endif +# endif +#endif + + +/** + * 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 <byteswap.h> +#define CPU_TO_LE32( x ) bswap_32( x ) +#elif defined(__APPLE__) +#include <CoreFoundation/CFByteOrder.h> +#define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x ) +#else /*__linux__ __APPLE__*/ +#include <sys/endian.h> +#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 ) + + + +#if !defined(CAPI) && defined(WIN32) && !defined(BUILD_FOR_SNAP) +#define CAPI _cdecl +#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 + + +/* 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 + + +/** + * ASSERT macro + */ +#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 + + +#ifndef NULL +#define NULL 0 +#endif + + +/** + * LONGSTRING macro + * 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 + + +#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 + + +/** + * 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 + + +/** + * START/END_FAST_MATH macros: + * + * 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 + + +#ifndef Elements +#define Elements(x) (sizeof(x)/sizeof(*(x))) +#endif + + + +#ifdef __cplusplus +} +#endif + + +#endif /* COMPILER_H */ diff --git a/mesa/main/config.h b/mesa/main/config.h index f74576e..f7acd2f 100644 --- a/mesa/main/config.h +++ b/mesa/main/config.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.3 + * Version: 7.5 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * Copyright (C) 2008 VMware, Inc. All Rights Reserved. @@ -32,9 +32,6 @@ #define MESA_CONFIG_H_INCLUDED -#include "main/mfeatures.h" - - /** * \name OpenGL implementation limits */ @@ -71,7 +68,7 @@ #define MAX_PIXEL_MAP_TABLE 256 /** Maximum number of auxillary color buffers */ -#define MAX_AUX_BUFFERS 4 +#define MAX_AUX_BUFFERS 1 /** Maximum order (degree) of curves */ #ifdef AMIGA @@ -101,16 +98,16 @@ #define MAX_COLOR_TABLE_SIZE 256 /** Number of 1D/2D texture mipmap levels */ -#define MAX_TEXTURE_LEVELS 12 +#define MAX_TEXTURE_LEVELS 13 /** 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 +#define MAX_CUBE_TEXTURE_LEVELS 13 /** Maximum rectangular texture size - GL_NV_texture_rectangle */ -#define MAX_TEXTURE_RECT_SIZE 2048 +#define MAX_TEXTURE_RECT_SIZE 4096 /** Maximum number of layers in a 1D or 2D array texture - GL_MESA_texture_array */ #define MAX_ARRAY_TEXTURE_LAYERS 64 @@ -166,7 +163,7 @@ #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 +#define MAX_TEXTURE_LOD_BIAS 12.0 /** For GL_ARB_vertex_program */ /*@{*/ @@ -177,22 +174,20 @@ /** 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_INSTRUCTIONS (16 * 1024) #define MAX_PROGRAM_LOCAL_PARAMS 256 /**< per-program constants (power of two) */ -#define MAX_PROGRAM_ENV_PARAMS 128 +#define MAX_PROGRAM_ENV_PARAMS 256 /**< per-context constants (power of two) */ #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_TEMPS 256 #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_VARYING 16 /**< number of float[4] vectors */ #define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS #define MAX_PROGRAM_INPUTS 32 #define MAX_PROGRAM_OUTPUTS 32 @@ -202,7 +197,7 @@ /*@{*/ #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_PARAMS 96 #define MAX_NV_VERTEX_PROGRAM_INPUTS 16 #define MAX_NV_VERTEX_PROGRAM_OUTPUTS 15 /*@}*/ @@ -220,7 +215,7 @@ /** For GL_ARB_vertex_shader */ /*@{*/ -#define MAX_VERTEX_ATTRIBS 16 +#define MAX_VERTEX_GENERIC_ATTRIBS 16 #define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS #define MAX_COMBINED_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS /*@}*/ @@ -237,7 +232,8 @@ #define MAX_COLOR_ATTACHMENTS 8 /*@}*/ - +/** For GL_ATI_envmap_bump - support bump mapping on first 8 units */ +#define SUPPORTED_ATI_BUMP_UNITS 0xff /** * \name Mesa-specific parameters diff --git a/mesa/main/context.h b/mesa/main/context.h index 8c1196d..0531ae8 100644 --- a/mesa/main/context.h +++ b/mesa/main/context.h @@ -49,11 +49,13 @@ #define CONTEXT_H -#include "glapi/glapi.h" #include "imports.h" #include "mtypes.h" +struct _glapi_table; + + /** \name Visual-related functions */ /*@{*/ @@ -129,12 +131,12 @@ _mesa_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask); extern void +_mesa_check_init_viewport(GLcontext *ctx, GLuint width, GLuint height); + +extern GLboolean _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); @@ -152,6 +154,10 @@ extern struct _glapi_table * _mesa_get_dispatch(GLcontext *ctx); +void +_mesa_set_mvp_with_dp4( GLcontext *ctx, + GLboolean flag ); + /** \name Miscellaneous */ /*@{*/ diff --git a/mesa/main/dd.h b/mesa/main/dd.h index ddb3803..32b1d4e 100644 --- a/mesa/main/dd.h +++ b/mesa/main/dd.h @@ -34,7 +34,23 @@ /* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */ struct gl_pixelstore_attrib; -struct mesa_display_list; +struct gl_display_list; + +#if FEATURE_ARB_vertex_buffer_object +/* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return + * NULL) if buffer is unavailable for immediate mapping. + * + * Does GL_MAP_INVALIDATE_RANGE_BIT do this? It seems so, but it + * would require more book-keeping in the driver than seems necessary + * at this point. + * + * Does GL_MAP_INVALDIATE_BUFFER_BIT do this? Not really -- we don't + * want to provoke the driver to throw away the old storage, we will + * respect the contents of already referenced data. + */ +#define MESA_MAP_NOWAIT_BIT 0x0040 +#endif + /** * Device driver function table. @@ -586,9 +602,6 @@ struct dd_function_table { /** 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, @@ -785,6 +798,16 @@ struct dd_function_table { void * (*MapBuffer)( GLcontext *ctx, GLenum target, GLenum access, struct gl_buffer_object *obj ); + /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access: + */ + void * (*MapBufferRange)( GLcontext *ctx, GLenum target, + GLintptr offset, GLsizeiptr length, GLbitfield access, + struct gl_buffer_object *obj); + + void (*FlushMappedBufferRange) (GLcontext *ctx, GLenum target, + GLintptr offset, GLsizeiptr length, + struct gl_buffer_object *obj); + GLboolean (*UnmapBuffer)( GLcontext *ctx, GLenum target, struct gl_buffer_object *obj ); /*@}*/ @@ -808,6 +831,8 @@ struct dd_function_table { struct gl_renderbuffer_attachment *att); void (*FinishRenderTexture)(GLcontext *ctx, struct gl_renderbuffer_attachment *att); + void (*ValidateFramebuffer)(GLcontext *ctx, + struct gl_framebuffer *fb); /*@}*/ #endif #if FEATURE_EXT_framebuffer_blit @@ -886,7 +911,7 @@ struct dd_function_table { 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, + GLint location, GLsizei count, GLboolean transpose, const GLfloat *values); void (*UseProgram)(GLcontext *ctx, GLuint program); void (*ValidateProgram)(GLcontext *ctx, GLuint program); @@ -952,6 +977,12 @@ struct dd_function_table { GLuint NeedFlush; GLuint SaveNeedFlush; + + /* Called prior to any of the GLvertexformat functions being + * called. Paired with Driver.FlushVertices(). + */ + void (*BeginVertices)( GLcontext *ctx ); + /** * If inside glBegin()/glEnd(), it should ASSERT(0). Otherwise, if * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered @@ -997,7 +1028,7 @@ struct dd_function_table { * Notify the T&L component before and after calling a display list. */ void (*BeginCallList)( GLcontext *ctx, - struct mesa_display_list *dlist ); + struct gl_display_list *dlist ); /** * Called by glEndCallList(). * diff --git a/mesa/main/enums.h b/mesa/main/enums.h index 23a4767..b5f6900 100644 --- a/mesa/main/enums.h +++ b/mesa/main/enums.h @@ -40,6 +40,12 @@ #if defined(_HAVE_FULL_GL) && _HAVE_FULL_GL extern const char *_mesa_lookup_enum_by_nr( int nr ); + +/* Get the name of an enum given that it is a primitive type. Avoids + * GL_FALSE/GL_POINTS ambiguity and others. + */ +const char *_mesa_lookup_prim_by_nr( int nr ); + extern int _mesa_lookup_enum_by_name( const char *symbol ); #else diff --git a/mesa/main/fbobject.h b/mesa/main/fbobject.h index b615471..5409394 100644 --- a/mesa/main/fbobject.h +++ b/mesa/main/fbobject.h @@ -84,6 +84,11 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); extern void GLAPIENTRY +_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples, + GLenum internalformat, + GLsizei width, GLsizei height); + +extern void GLAPIENTRY _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params); diff --git a/mesa/main/framebuffer.h b/mesa/main/framebuffer.h index e9eeed2..45a4703 100644 --- a/mesa/main/framebuffer.h +++ b/mesa/main/framebuffer.h @@ -47,9 +47,6 @@ _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); diff --git a/mesa/main/glheader.h b/mesa/main/glheader.h index d17be37..81d4ccf 100644 --- a/mesa/main/glheader.h +++ b/mesa/main/glheader.h @@ -1,28 +1,8 @@ -/** - * \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 + * Version: 7.5 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * 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"), @@ -43,88 +23,22 @@ */ -#ifndef GLHEADER_H -#define GLHEADER_H - -#include <assert.h> -#include <ctype.h> -#if defined(__alpha__) && defined(CCPML) -#include <cpml.h> /* use Compaq's Fast Math Library on Alpha */ -#else -#include <math.h> -#endif -#include <limits.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#if defined(__linux__) && defined(__i386__) -#include <fpu_control.h> -#endif -#include <float.h> -#include <stdarg.h> - - -/* Get typedefs for uintptr_t and friends */ -#if defined(__MINGW32__) || defined(__NetBSD__) -# include <stdint.h> -#elif defined(_WIN32) -# include <BaseTsd.h> -# 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 <inttypes.h> -#endif - +/** + * \file glheader.h + * Wrapper for GL/gl.h and GL/glext.h + */ -/* 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 +#ifndef GLHEADER_H +#define GLHEADER_H -#if defined(__WATCOMC__) -# define finite _finite -# pragma disable_message(201) /* Disable unreachable code warnings */ -#endif #ifdef WGLAPI -# undef 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 */ @@ -135,34 +49,10 @@ #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 <byteswap.h> -#define CPU_TO_LE32( x ) bswap_32( x ) -#elif defined(__APPLE__) -#include <CoreFoundation/CFByteOrder.h> -#define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x ) -#else /*__linux__ __APPLE__*/ -#include <sys/endian.h> -#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" +#include "GL/internal/glcore.h" #ifndef GL_FIXED @@ -184,129 +74,15 @@ #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 +#ifndef GL_PROGRAM_BINARY_LENGTH_OES +#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 #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. +/** + * Special, internal token */ -#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__ "<unknown>" -# endif -# endif -#endif - +#define GL_SHADER_PROGRAM_MESA 0x9999 -#include "config.h" #endif /* GLHEADER_H */ diff --git a/mesa/main/image.h b/mesa/main/image.h index 0e0bbd9..b26c27e 100644 --- a/mesa/main/image.h +++ b/mesa/main/image.h @@ -198,6 +198,13 @@ _mesa_unpack_color_span_float( GLcontext *ctx, const struct gl_pixelstore_attrib *srcPacking, GLbitfield transferOps ); +extern void +_mesa_unpack_dudv_span_byte( GLcontext *ctx, + GLuint n, GLenum dstFormat, GLbyte 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, diff --git a/mesa/main/imports.h b/mesa/main/imports.h index e560bc0..7b61e22 100644 --- a/mesa/main/imports.h +++ b/mesa/main/imports.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.5 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * @@ -36,10 +36,8 @@ #define IMPORTS_H -/* XXX some of the stuff in glheader.h should be moved into this file. - */ +#include "compiler.h" #include "glheader.h" -#include <GL/internal/glcore.h> #ifdef __cplusplus @@ -48,26 +46,6 @@ extern "C" { /**********************************************************************/ -/** \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 */ /*@{*/ @@ -130,49 +108,11 @@ typedef union { GLfloat f; GLint i; } fi_type; #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 */ @@ -316,15 +256,7 @@ static INLINE int GET_FLOAT_BITS( float x ) /*** *** 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__) && \ +#if 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) @@ -509,113 +441,6 @@ _mesa_is_pow_two(int x) #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. */ @@ -709,14 +534,10 @@ extern double _mesa_pow(double x, double y); extern int -_mesa_ffs(int i); +_mesa_ffs(int32_t i); extern int -#ifdef __MINGW32__ -_mesa_ffsll(long i); -#else -_mesa_ffsll(long long i); -#endif +_mesa_ffsll(int64_t i); extern unsigned int _mesa_bitcount(unsigned int n); diff --git a/mesa/main/macros.h b/mesa/main/macros.h index 2630855..4ca7957 100644 --- a/mesa/main/macros.h +++ b/mesa/main/macros.h @@ -54,34 +54,59 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; #define FLOAT_TO_BYTE(X) ( (((GLint) (255.0F * (X))) - 1) / 2 ) -/** Convert GLushort in [0,65536] to GLfloat in [0.0,1.0] */ +/** Convert GLbyte in [-128,127] to GLfloat in [-1.0,1.0], texture/fb data */ +#define BYTE_TO_FLOAT_TEX(B) ((B) == -128 ? -1.0F : (B) * (1.0F/127.0F)) + +/** Convert GLfloat in [-1.0,1.0] to GLbyte in [-128,127], texture/fb data */ +#define FLOAT_TO_BYTE_TEX(X) ( (GLint) (127.0F * (X)) ) + + +/** Convert GLushort in [0,65535] to GLfloat in [0.0,1.0] */ #define USHORT_TO_FLOAT(S) ((GLfloat) (S) * (1.0F / 65535.0F)) +/** Convert GLfloat in [0.0,1.0] to GLushort in [0, 65535] */ +#define FLOAT_TO_USHORT(X) ((GLuint) ((X) * 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] */ +/** Convert GLfloat in [-1.0,1.0] to GLshort in [-32768,32767] */ #define FLOAT_TO_SHORT(X) ( (((GLint) (65535.0F * (X))) - 1) / 2 ) +/** Convert GLshort in [-32768,32767] to GLfloat in [-1.0,1.0], texture/fb data */ +#define SHORT_TO_FLOAT_TEX(S) ((S) == -32768 ? -1.0F : (S) * (1.0F/32767.0F)) + +/** Convert GLfloat in [-1.0,1.0] to GLshort in [-32768,32767], texture/fb data */ +#define FLOAT_TO_SHORT_TEX(X) ( (GLint) (32767.0F * (X)) ) + + /** Convert GLuint in [0,4294967295] to GLfloat in [0.0,1.0] */ -#define UINT_TO_FLOAT(U) ((GLfloat) (U) * (1.0F / 4294967295.0F)) +#define UINT_TO_FLOAT(U) ((GLfloat) (U) * (1.0F / 4294967295.0)) /** 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)) +#define INT_TO_FLOAT(I) ((2.0F * (I) + 1.0F) * (1.0F/4294967294.0)) /** 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 ) +#define FLOAT_TO_INT(X) ( (((GLint) (4294967294.0 * (X))) - 1) / 2 ) */ /* a close approximation: */ #define FLOAT_TO_INT(X) ( (GLint) (2147483647.0 * (X)) ) +/** Convert GLint in [-2147483648,2147483647] to GLfloat in [-1.0,1.0], texture/fb data */ +#define INT_TO_FLOAT_TEX(I) ((I) == -2147483648 ? -1.0F : (I) * (1.0F/2147483647.0)) + +/** Convert GLfloat in [-1.0,1.0] to GLint in [-2147483648,2147483647], texture/fb data */ +#define FLOAT_TO_INT_TEX(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)) @@ -95,7 +120,7 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; #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) ) + us = ( (GLushort) IROUND( CLAMP((f), 0.0F, 1.0F) * 65535.0F) ) #define CLAMPED_FLOAT_TO_USHORT(us, f) \ us = ( (GLushort) IROUND( (f) * 65535.0F) ) diff --git a/mesa/main/matrix.h b/mesa/main/matrix.h index 3876986..a53d104 100644 --- a/mesa/main/matrix.h +++ b/mesa/main/matrix.h @@ -1,13 +1,9 @@ -/** - * \file matrix.h - * Matrix operations. - */ - /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 7.5 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * 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"), @@ -99,15 +95,6 @@ _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 ); @@ -115,16 +102,10 @@ _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 ); diff --git a/mesa/main/mfeatures.h b/mesa/main/mfeatures.h index 3819da3..62c3ead 100644 --- a/mesa/main/mfeatures.h +++ b/mesa/main/mfeatures.h @@ -60,6 +60,8 @@ #define FEATURE_ARB_occlusion_query _HAVE_FULL_GL #define FEATURE_ARB_fragment_program _HAVE_FULL_GL +#define FEATURE_ARB_framebuffer_object _HAVE_FULL_GL +#define FEATURE_ARB_pixel_buffer_object _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 @@ -74,7 +76,6 @@ #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 diff --git a/mesa/main/mtypes.h b/mesa/main/mtypes.h index f5826ca..3b0ebcb 100644 --- a/mesa/main/mtypes.h +++ b/mesa/main/mtypes.h @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.3 + * Version: 7.5 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * Copyright (C) 1999-2008 VMware, Inc. All Rights Reserved. + * 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"), @@ -30,22 +30,16 @@ * Please try to mark derived values with a leading underscore ('_'). */ -#ifndef TYPES_H -#define TYPES_H +#ifndef MTYPES_H +#define MTYPES_H -#include "glheader.h" -#include <GL/internal/glcore.h> /* __GLcontextModes (GLvisual) */ -#include "config.h" /* Hardwired parameters */ +#include "main/glheader.h" +#include "main/config.h" +#include "main/compiler.h" +#include "main/mfeatures.h" #include "glapi/glapi.h" #include "math/m_matrix.h" /* GLmatrix */ -#include "bitset.h" - - -/** - * Special, internal token - */ -#define GL_SHADER_PROGRAM_MESA 0x9999 /** @@ -84,47 +78,17 @@ /** - * 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_attrib_node; struct gl_pixelstore_attrib; struct gl_program_cache; struct gl_texture_format; struct gl_texture_image; struct gl_texture_object; +struct st_context; typedef struct __GLcontextRec GLcontext; typedef struct __GLcontextModesRec GLvisual; typedef struct gl_framebuffer GLframebuffer; @@ -139,7 +103,7 @@ typedef struct gl_framebuffer GLframebuffer; * In GL_ARB_vertex_shader / OpenGL 2.0 the aliasing is disallowed (the * generic attributes are distinct/separate). */ -enum +typedef enum { VERT_ATTRIB_POS = 0, VERT_ATTRIB_WEIGHT = 1, @@ -175,7 +139,7 @@ enum VERT_ATTRIB_GENERIC14 = 30, VERT_ATTRIB_GENERIC15 = 31, VERT_ATTRIB_MAX = 32 -}; +} gl_vert_attrib; /** * Bitflags for vertex attributes. @@ -223,32 +187,33 @@ enum /** * 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) -/*@}*/ +typedef enum +{ + VERT_RESULT_HPOS = 0, + VERT_RESULT_COL0 = 1, + VERT_RESULT_COL1 = 2, + VERT_RESULT_FOGC = 3, + VERT_RESULT_TEX0 = 4, + VERT_RESULT_TEX1 = 5, + VERT_RESULT_TEX2 = 6, + VERT_RESULT_TEX3 = 7, + VERT_RESULT_TEX4 = 8, + VERT_RESULT_TEX5 = 9, + VERT_RESULT_TEX6 = 10, + VERT_RESULT_TEX7 = 11, + VERT_RESULT_PSIZ = 12, + VERT_RESULT_BFC0 = 13, + VERT_RESULT_BFC1 = 14, + VERT_RESULT_EDGE = 15, + VERT_RESULT_VAR0 = 16 /**< shader varying */, + VERT_RESULT_MAX = (VERT_RESULT_VAR0 + MAX_VARYING) +} gl_vert_result; /** * Indexes for fragment program input attributes. */ -enum +typedef enum { FRAG_ATTRIB_WPOS = 0, FRAG_ATTRIB_COL0 = 1, @@ -264,7 +229,7 @@ enum FRAG_ATTRIB_TEX7 = 11, FRAG_ATTRIB_VAR0 = 12, /**< shader varying */ FRAG_ATTRIB_MAX = (FRAG_ATTRIB_VAR0 + MAX_VARYING) -}; +} gl_frag_attrib; /** * Bitflags for fragment program input attributes. @@ -301,41 +266,41 @@ enum /** * Fragment program results */ -enum +typedef enum { - FRAG_RESULT_COLR = 0, - FRAG_RESULT_COLH = 1, - FRAG_RESULT_DEPR = 2, - FRAG_RESULT_DATA0 = 3, + FRAG_RESULT_DEPTH = 0, + FRAG_RESULT_COLOR = 1, + FRAG_RESULT_DATA0 = 2, FRAG_RESULT_MAX = (FRAG_RESULT_DATA0 + MAX_DRAW_BUFFERS) -}; +} gl_frag_result; /** * 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 -}; +typedef enum +{ + /* the four standard color buffers */ + BUFFER_FRONT_LEFT, + BUFFER_BACK_LEFT, + BUFFER_FRONT_RIGHT, + BUFFER_BACK_RIGHT, + BUFFER_DEPTH, + BUFFER_STENCIL, + BUFFER_ACCUM, + /* optional aux buffer */ + BUFFER_AUX0, + /* generic renderbuffers */ + BUFFER_COLOR0, + BUFFER_COLOR1, + BUFFER_COLOR2, + BUFFER_COLOR3, + BUFFER_COLOR4, + BUFFER_COLOR5, + BUFFER_COLOR6, + BUFFER_COLOR7, + BUFFER_COUNT +} gl_buffer_index; /** * Bit flags for all renderbuffers @@ -368,9 +333,6 @@ enum { 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 | \ @@ -382,12 +344,13 @@ enum { /** The pixel transfer path has three color tables: */ -/*@{*/ -#define COLORTABLE_PRECONVOLUTION 0 -#define COLORTABLE_POSTCONVOLUTION 1 -#define COLORTABLE_POSTCOLORMATRIX 2 -#define COLORTABLE_MAX 3 -/*@}*/ +typedef enum +{ + COLORTABLE_PRECONVOLUTION, + COLORTABLE_POSTCONVOLUTION, + COLORTABLE_POSTCOLORMATRIX, + COLORTABLE_MAX +} gl_colortable_index; /** @@ -497,7 +460,7 @@ struct gl_light GLfloat Diffuse[4]; /**< diffuse color */ GLfloat Specular[4]; /**< specular color */ GLfloat EyePosition[4]; /**< position in eye coordinates */ - GLfloat EyeDirection[4]; /**< spotlight dir in eye coordinates */ + GLfloat SpotDirection[4]; /**< spotlight direction in eye coordinates */ GLfloat SpotExponent; GLfloat SpotCutoff; /**< in degrees */ GLfloat _CosCutoffNeg; /**< = cos(SpotCutoff) */ @@ -516,7 +479,7 @@ struct gl_light GLfloat _Position[4]; /**< position in eye/obj coordinates */ GLfloat _VP_inf_norm[3]; /**< Norm direction to infinite light */ GLfloat _h_inf_norm[3]; /**< Norm( _VP_inf_norm + <0,0,1> ) */ - GLfloat _NormDirection[4]; /**< normalized spotlight direction */ + GLfloat _NormSpotDirection[4]; /**< normalized spotlight direction */ GLfloat _VP_inf_spot_attenuation; GLfloat _SpotExpTable[EXP_TABLE_SIZE][2]; /**< to replace a pow() call */ @@ -624,9 +587,7 @@ struct gl_current_attrib * \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). @@ -659,84 +620,6 @@ struct gl_depthbuffer_attrib /** - * 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 @@ -823,11 +706,11 @@ struct gl_hint_attrib */ 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 */ + 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; @@ -901,7 +784,7 @@ struct gl_light_attrib /*@{*/ GLboolean _NeedEyeCoords; GLboolean _NeedVertices; /**< Use fast shader? */ - GLbitfield _Flags; /**< LIGHT_* flags, see above */ + GLbitfield _Flags; /**< LIGHT_* flags, see above */ GLfloat _BaseColor[2][3]; /*@}*/ }; @@ -1006,13 +889,15 @@ struct gl_pixel_attrib /*--- Begin Pixel Transfer State ---*/ /* Fields are in the order in which they're applied... */ - /* Scale & Bias (index shift, offset) */ + /** 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 */ @@ -1028,7 +913,7 @@ struct gl_pixel_attrib GLboolean Convolution1DEnabled; GLboolean Convolution2DEnabled; GLboolean Separable2DEnabled; - GLfloat ConvolutionBorderColor[3][4]; + GLfloat ConvolutionBorderColor[3][4]; /**< RGBA */ GLenum ConvolutionBorderMode[3]; GLfloat ConvolutionFilterScale[3][4]; /**< RGBA */ GLfloat ConvolutionFilterBias[3][4]; /**< RGBA */ @@ -1047,12 +932,12 @@ struct gl_pixel_attrib /*--- End Pixel Transfer State ---*/ - /* Pixel Zoom */ + /** glPixelZoom */ GLfloat ZoomX, ZoomY; /** GL_SGI_texture_color_table */ - GLfloat TextureColorTableScale[4]; - GLfloat TextureColorTableBias[4]; + GLfloat TextureColorTableScale[4]; /**< RGBA */ + GLfloat TextureColorTableBias[4]; /**< RGBA */ }; @@ -1127,6 +1012,7 @@ 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 _Enabled; /**< Enabled and stencil buffer present */ GLboolean _TestTwoSide; GLubyte _BackFace; /**< Current back stencil state (1 or 2) */ GLenum Function[3]; /**< Stencil function */ @@ -1140,33 +1026,36 @@ struct gl_stencil_attrib }; -#define NUM_TEXTURE_TARGETS 7 /* 1D, 2D, 3D, CUBE, RECT, 1D_STACK, and 2D_STACK */ - /** - * An index for each type of texture object + * An index for each type of texture object. These correspond to the GL + * target target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc. + * Note: the order is from highest priority to lowest priority. */ -/*@{*/ -#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 -/*@}*/ +typedef enum +{ + TEXTURE_2D_ARRAY_INDEX, + TEXTURE_1D_ARRAY_INDEX, + TEXTURE_CUBE_INDEX, + TEXTURE_3D_INDEX, + TEXTURE_RECT_INDEX, + TEXTURE_2D_INDEX, + TEXTURE_1D_INDEX, + NUM_TEXTURE_TARGETS +} gl_texture_index; + /** * 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_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX) +#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX) #define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX) +#define TEXTURE_3D_BIT (1 << TEXTURE_3D_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) +#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX) +#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX) /*@}*/ @@ -1201,27 +1090,12 @@ struct gl_stencil_attrib /*@}*/ -/* 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 +/** Tex-gen enabled for texture unit? */ +#define ENABLE_TEXGEN(unit) (1 << (unit)) -#define ENABLE_TEXGEN(i) (ENABLE_TEXGEN0 << (i)) -#define ENABLE_TEXMAT(i) (ENABLE_TEXMAT0 << (i)) +/** Non-identity texture matrix for texture unit? */ +#define ENABLE_TEXMAT(unit) (1 << (unit)) /** @@ -1397,15 +1271,16 @@ struct gl_texture_image /** * 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 -/*@}*/ +typedef enum +{ + FACE_POS_X = 0, + FACE_NEG_X = 1, + FACE_POS_Y = 2, + FACE_NEG_Y = 3, + FACE_POS_Z = 4, + FACE_NEG_Z = 5, + MAX_FACES = 6 +} gl_face_index; /** @@ -1421,7 +1296,6 @@ struct gl_texture_object 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 */ @@ -1433,21 +1307,18 @@ struct gl_texture_object 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. - */ + GLfloat CompareFailValue; /**< GL_ARB_shadow_ambient */ 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 */ + GLenum Swizzle[4]; /**< GL_EXT_texture_swizzle */ + GLuint _Swizzle; /**< same as Swizzle, but SWIZZLE_* format */ GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */ GLboolean _Complete; /**< Is texture object complete? */ + GLboolean _RenderToTexture; /**< Any rendering to this texture? */ /** Actual texture images, indexed by [cube face] and [mipmap level] */ struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS]; @@ -1466,25 +1337,39 @@ struct gl_texture_object }; +/** Up to four combiner sources are possible with GL_NV_texture_env_combine4 */ +#define MAX_COMBINER_TERMS 4 + + /** * 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 */ + /** Source terms: GL_PRIMARY_COLOR, GL_TEXTURE, etc */ + GLenum SourceRGB[MAX_COMBINER_TERMS]; + GLenum SourceA[MAX_COMBINER_TERMS]; + /** Source operands: GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, etc */ + GLenum OperandRGB[MAX_COMBINER_TERMS]; + GLenum OperandA[MAX_COMBINER_TERMS]; 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. */ + GLuint _NumArgsRGB; /**< Number of inputs used for the RGB combiner */ + GLuint _NumArgsA; /**< Number of inputs used for the A combiner */ +}; + + +/** + * Texture coord generation state. + */ +struct gl_texgen +{ + GLenum Mode; /**< GL_EYE_LINEAR, GL_SPHERE_MAP, etc */ + GLbitfield _ModeBit; /**< TEXGEN_x bit corresponding to Mode */ + GLfloat ObjectPlane[4]; + GLfloat EyePlane[4]; }; @@ -1500,29 +1385,17 @@ struct gl_texture_unit GLenum EnvMode; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */ GLfloat EnvColor[4]; + + struct gl_texgen GenS; + struct gl_texgen GenT; + struct gl_texgen GenR; + struct gl_texgen GenQ; 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]; + GLbitfield _GenFlags; /**< Bitwise-OR of Gen[STRQ]._ModeBit */ + GLfloat LodBias; /**< for biasing mipmap levels */ + GLenum BumpTarget; + GLfloat RotMatrix[4]; /* 2x2 matrix */ /** * \name GL_EXT_texture_env_combine @@ -1556,32 +1429,34 @@ struct gl_texture_unit }; - /** * 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; - /**@}*/ - + GLuint CurrentUnit; /**< GL_ACTIVE_TEXTURE */ 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; + + /** Texture units/samplers used by vertex or fragment texturing */ + GLbitfield _EnabledUnits; + + /** Texture coord units/sets used for fragment texturing */ + GLbitfield _EnabledCoordUnits; + + /** Texture coord units that have texgen enabled */ + GLbitfield _TexGenEnabled; + + /** Texture coord units that have non-identity matrices */ + GLbitfield _TexMatEnabled; + + /** Bitwise-OR of all Texture.Unit[i]._GenFlags */ + GLbitfield _GenFlags; }; @@ -1617,17 +1492,6 @@ struct gl_viewport_attrib /** - * 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 @@ -1637,13 +1501,14 @@ struct gl_buffer_object GLenum Usage; GLenum Access; GLvoid *Pointer; /**< Only valid while buffer is mapped */ + GLintptr Offset; /**< mapped offset */ + GLsizeiptr Length; /**< mapped length */ 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 */ @@ -1653,8 +1518,8 @@ struct gl_pixelstore_attrib GLint RowLength; GLint SkipPixels; GLint SkipRows; - GLint ImageHeight; /**< for GL_EXT_texture3D */ - GLint SkipImages; /**< for GL_EXT_texture3D */ + GLint ImageHeight; + GLint SkipImages; GLboolean SwapBytes; GLboolean LsbFirst; GLboolean ClientStorage; /**< GL_APPLE_client_storage */ @@ -1663,7 +1528,6 @@ struct gl_pixelstore_attrib }; - /** * Client vertex array attributes */ @@ -1671,6 +1535,7 @@ struct gl_client_array { GLint Size; /**< components per element (1,2,3,4) */ GLenum Type; /**< datatype: GL_FLOAT, GL_INT, etc */ + GLenum Format; /**< default: GL_RGBA, but may be GL_BGRA */ GLsizei Stride; /**< user-specified stride */ GLsizei StrideB; /**< actual stride in bytes */ const GLubyte *Ptr; /**< Points to array data */ @@ -1692,6 +1557,9 @@ struct gl_array_object /** Name of the array object as received from glGenVertexArrayAPPLE. */ GLuint Name; + GLint RefCount; + _glthread_Mutex Mutex; + /** Conventional vertex arrays */ /*@{*/ struct gl_client_array Vertex; @@ -1742,7 +1610,7 @@ struct gl_array_attrib struct gl_feedback { GLenum Type; - GLbitfield _Mask; /* FB_* bits */ + GLbitfield _Mask; /**< FB_* bits */ GLfloat *Buffer; GLuint BufferSize; GLuint Count; @@ -1840,24 +1708,24 @@ struct gl_evaluators * 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 */ +typedef enum +{ + PROGRAM_TEMPORARY, /**< machine->Temporary[] */ + PROGRAM_INPUT, /**< machine->Inputs[] */ + PROGRAM_OUTPUT, /**< machine->Outputs[] */ + PROGRAM_VARYING, /**< machine->Inputs[]/Outputs[] */ + PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */ + PROGRAM_ENV_PARAM, /**< gl_program->Parameters[] */ + PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */ + PROGRAM_NAMED_PARAM, /**< gl_program->Parameters[] */ + PROGRAM_CONSTANT, /**< gl_program->Parameters[] */ + PROGRAM_UNIFORM, /**< gl_program->Parameters[] */ + PROGRAM_WRITE_ONLY, /**< A dummy, write-only register */ + PROGRAM_ADDRESS, /**< machine->AddressReg */ + PROGRAM_SAMPLER, /**< for shader samplers, compile-time only */ + PROGRAM_UNDEFINED, /**< Invalid/TBD value */ PROGRAM_FILE_MAX -}; +} gl_register_file; /** Vertex and fragment instructions */ @@ -1966,14 +1834,14 @@ struct gl_program_state */ 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 */ + 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). + /** 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; @@ -1993,12 +1861,7 @@ struct gl_vertex_program_state /** Cache of fixed-function programs */ struct gl_program_cache *Cache; -#if FEATURE_MESA_program_debug - GLprogramcallbackMESA Callback; - GLvoid *CallbackData; - GLboolean CallbackEnabled; - GLuint CurrentPosition; -#endif + GLboolean _Overriden; }; @@ -2011,8 +1874,8 @@ struct gl_fragment_program_state 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). + /** 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; @@ -2027,13 +1890,6 @@ struct gl_fragment_program_state /** Cache of fixed-function programs */ struct gl_program_cache *Cache; - -#if FEATURE_MESA_program_debug - GLprogramcallbackMESA Callback; - GLvoid *CallbackData; - GLboolean CallbackEnabled; - GLuint CurrentPosition; -#endif }; @@ -2107,6 +1963,8 @@ struct gl_query_state /** Set by #pragma directives */ struct gl_sl_pragmas { + GLboolean IgnoreOptimize; /**< ignore #pragma optimize(on/off) ? */ + GLboolean IgnoreDebug; /**< ignore #pragma debug(on/off) ? */ GLboolean Optimize; /**< defaults on */ GLboolean Debug; /**< defaults off */ }; @@ -2123,6 +1981,7 @@ struct gl_shader GLboolean DeletePending; GLboolean CompileStatus; GLboolean Main; /**< shader defines main() */ + GLboolean UnresolvedRefs; const GLchar *Source; /**< Source code string */ struct gl_program *Program; /**< Post-compile assembly code */ GLchar *InfoLog; @@ -2158,6 +2017,13 @@ struct gl_shader_program }; +#define GLSL_DUMP 0x1 /**< Dump shaders to stdout */ +#define GLSL_LOG 0x2 /**< Write shaders to files */ +#define GLSL_OPT 0x4 /**< Force optimizations (override pragmas) */ +#define GLSL_NO_OPT 0x8 /**< Force no optimizations (override pragmas) */ +#define GLSL_UNIFORMS 0x10 /**< Print glUniform calls */ + + /** * Context state for GLSL vertex/fragment shaders. */ @@ -2166,9 +2032,12 @@ 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 EmitContReturn; /**< Emit CONT/RET opcodes? */ GLboolean EmitCondCodes; /**< Use condition codes? */ GLboolean EmitComments; /**< Annotated instructions */ void *MemPool; + GLbitfield Flags; /**< Mask of GLSL_x flags */ + struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */ }; @@ -2185,6 +2054,9 @@ struct gl_shared_state /** Default texture objects (shared by all texture units) */ struct gl_texture_object *DefaultTex[NUM_TEXTURE_TARGETS]; + /** Fallback texture used when a bound texture is incomplete */ + struct gl_texture_object *FallbackTex; + /** * \name Thread safety and statechange notification for texture * objects. @@ -2260,7 +2132,9 @@ struct gl_renderbuffer 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 */ + GLenum ColorEncoding; /**< GL_LINEAR or GL_SRGB */ + GLenum ComponentType; /**< GL_FLOAT, GL_INT, GL_UNSIGNED_INT, + GL_UNSIGNED_NORMALIZED or GL_INDEX */ GLubyte RedBits; /**< Bits of red per pixel */ GLubyte GreenBits; GLubyte BlueBits; @@ -2268,6 +2142,9 @@ struct gl_renderbuffer GLubyte IndexBits; GLubyte DepthBits; GLubyte StencilBits; + GLubyte NumSamples; + + GLenum DataType; /**< Type of values passed to the Get/Put functions */ GLvoid *Data; /**< This may not be used by some kinds of RBs */ /* Used to wrap one renderbuffer around another: */ @@ -2342,9 +2219,8 @@ struct gl_renderbuffer /** - * 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. + * A renderbuffer attachment 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 { @@ -2389,9 +2265,11 @@ struct gl_framebuffer 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. */ + /** + * The framebuffer's visual. Immutable if this is a window system buffer. + * Computed from attachments if user-made FBO. + */ + GLvisual Visual; GLboolean Initialized; @@ -2410,9 +2288,10 @@ struct gl_framebuffer GLfloat _MRD; /**< minimum resolvable difference in Z values */ /*@}*/ - GLenum _Status; /* One of the GL_FRAMEBUFFER_(IN)COMPLETE_* tokens */ + /** One of the GL_FRAMEBUFFER_(IN)COMPLETE_* tokens */ + GLenum _Status; - /* Array of all renderbuffer attachments, indexed by BUFFER_* 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 @@ -2474,50 +2353,60 @@ struct gl_program_constants */ 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 */ + GLint MaxTextureLevels; /**< Max mipmap levels. */ + GLint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */ + GLint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */ + GLint MaxArrayTextureLayers; /**< Max layers in array textures */ + GLint MaxTextureRectSize; /**< Max rectangle texture size, in pixes */ GLuint MaxTextureCoordUnits; GLuint MaxTextureImageUnits; - GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */ - GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ - GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */ + GLuint MaxVertexTextureImageUnits; + 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 MinPointSize, MaxPointSize; /**< aliased */ + GLfloat MinPointSizeAA, MaxPointSizeAA; /**< antialiased */ GLfloat PointSizeGranularity; - GLfloat MinLineWidth, MaxLineWidth; /* aliased */ - GLfloat MinLineWidthAA, MaxLineWidthAA; /* antialiased */ + 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 */ + 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: */ + + struct gl_program_constants VertexProgram; /**< GL_ARB_vertex_program */ + struct gl_program_constants FragmentProgram; /**< GL_ARB_fragment_program */ GLuint MaxProgramMatrices; GLuint MaxProgramMatrixStackDepth; - /* vertex array / buffer object bounds checking */ + + /** 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 */ + + GLuint MaxDrawBuffers; /**< GL_ARB_draw_buffers */ + + GLenum ColorReadFormat; /**< GL_OES_read_format */ + GLenum ColorReadType; /**< GL_OES_read_format */ + + GLuint MaxColorAttachments; /**< GL_EXT_framebuffer_object */ + GLuint MaxRenderbufferSize; /**< GL_EXT_framebuffer_object */ + GLuint MaxSamples; /**< GL_ARB_framebuffer_object */ + + GLuint MaxVarying; /**< Number of float[4] varying parameters */ + + GLbitfield SupportedBumpUnits; /**> units supporting GL_ATI_envmap_bumpmap as targets */ }; @@ -2527,18 +2416,13 @@ struct gl_constants */ 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_framebuffer_object; GLboolean ARB_half_float_pixel; GLboolean ARB_imaging; GLboolean ARB_multisample; @@ -2549,6 +2433,7 @@ struct gl_extensions GLboolean ARB_shading_language_100; GLboolean ARB_shading_language_120; GLboolean ARB_shadow; + GLboolean ARB_shadow_ambient; /* or GL_ARB_shadow_ambient */ GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_compression; GLboolean ARB_texture_cube_map; @@ -2609,13 +2494,16 @@ struct gl_extensions GLboolean EXT_texture_lod_bias; GLboolean EXT_texture_mirror_clamp; GLboolean EXT_texture_sRGB; + GLboolean EXT_texture_swizzle; GLboolean EXT_timer_query; GLboolean EXT_vertex_array; + GLboolean EXT_vertex_array_bgra; GLboolean EXT_vertex_array_set; /* vendor extensions */ GLboolean APPLE_client_storage; GLboolean APPLE_packed_pixels; GLboolean APPLE_vertex_array_object; + GLboolean ATI_envmap_bumpmap; GLboolean ATI_texture_mirror_once; GLboolean ATI_texture_env_combine3; GLboolean ATI_fragment_shader; @@ -2624,15 +2512,16 @@ struct gl_extensions 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 MESA_texture_signed_rgba; GLboolean NV_blend_square; GLboolean NV_fragment_program; GLboolean NV_light_max_exponent; GLboolean NV_point_sprite; GLboolean NV_texgen_reflection; + GLboolean NV_texture_env_combine4; GLboolean NV_texture_rectangle; GLboolean NV_vertex_program; GLboolean NV_vertex_program1_1; @@ -2643,12 +2532,9 @@ struct gl_extensions 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 */ + /** The extension string */ const GLubyte *String; }; @@ -2668,7 +2554,6 @@ struct gl_matrix_stack /** * \name Bits for image transfer operations - * * \sa __GLcontextRec::ImageTransferState. */ /*@{*/ @@ -2683,7 +2568,7 @@ struct gl_matrix_stack #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 */ +#define IMAGE_CLAMP_BIT 0x800 /** Pixel Transfer ops up to convolution */ @@ -2736,6 +2621,8 @@ struct gl_matrix_stack #define _NEW_MULTISAMPLE 0x2000000 /**< __GLcontextRec::Multisample */ #define _NEW_TRACK_MATRIX 0x4000000 /**< __GLcontextRec::VertexProgram */ #define _NEW_PROGRAM 0x8000000 /**< __GLcontextRec::VertexProgram */ +#define _NEW_CURRENT_ATTRIB 0x10000000 /**< __GLcontextRec::Current */ +#define _NEW_PROGRAM_CONSTANTS 0x20000000 #define _NEW_ALL ~0 /*@}*/ @@ -2818,6 +2705,10 @@ struct gl_matrix_stack /*@}*/ +/** + * Composite state flags + */ +/*@{*/ #define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \ _NEW_TEXTURE | \ _NEW_POINT | \ @@ -2827,17 +2718,12 @@ struct gl_matrix_stack #define _MESA_NEW_NEED_NORMALS (_NEW_LIGHT | \ _NEW_TEXTURE) -#define _IMAGE_NEW_TRANSFER_STATE (_NEW_PIXEL | _NEW_COLOR_MATRIX) - +#define _MESA_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" @@ -2868,21 +2754,31 @@ struct gl_tnl_module /*@}*/ }; -/* Strictly this is a tnl/ private concept, but it doesn't seem + +/** + * Display list flags. + * 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 +#define DLIST_DANGLING_REFS 0x1 + + +/** Opaque declaration of display list payload data type */ +union gl_dlist_node; -/* Provide a location where information about a display list can be + +/** + * 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 +struct gl_display_list { - Node *node; - GLuint id; - GLbitfield flags; + GLuint Name; + GLbitfield Flags; /**< DLIST_x flags */ + /** The dlist commands are in a linked list of nodes */ + union gl_dlist_node *Head; }; @@ -2893,10 +2789,8 @@ 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 */ + struct gl_display_list *CurrentList; /**< List currently being compiled */ + union gl_dlist_node *CurrentBlock; /**< Pointer to current block of nodes */ GLuint CurrentPos; /**< Index into current block of nodes */ GLvertexformat ListVtxfmt; @@ -2912,6 +2806,13 @@ struct gl_dlist_state GLubyte ActiveEdgeFlag; GLboolean CurrentEdgeFlag; + + struct { + /* State known to have been set by the currently-compiling display + * list. Used to eliminate some redundant state changes. + */ + GLenum ShadeModel; + } Current; }; @@ -3038,21 +2939,15 @@ struct __GLcontextRec 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_program_state Program; /**< general program state */ + struct gl_vertex_program_state VertexProgram; + struct gl_fragment_program_state FragmentProgram; + struct gl_ati_fragment_shader_state ATIFragmentShader; struct gl_shader_state Shader; /**< GLSL shader object state */ + + struct gl_query_state Query; /**< occlusion, timer queries */ /*@}*/ #if FEATURE_EXT_framebuffer_object @@ -3060,11 +2955,20 @@ struct __GLcontextRec #endif GLenum ErrorValue; /**< Last error code */ + + /** + * Recognize and silence repeated error debug messages in buggy apps. + */ + const char *ErrorDebugFmtString; + GLuint ErrorDebugCount; + GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */ GLbitfield NewState; /**< bitwise-or of _NEW_* flags */ GLboolean ViewportInitialized; /**< has viewport size been initialized? */ + GLbitfield varying_vp_inputs; /**< mask of VERT_BIT_* flags */ + /** \name Derived state */ /*@{*/ /** Bitwise-or of DD_* flags. Note that this bitfield may be used before @@ -3076,9 +2980,8 @@ struct __GLcontextRec GLfloat _ModelViewInvScale; GLboolean _NeedEyeCoords; GLboolean _ForceEyeCoords; - GLenum _CurrentProgram; /* currently executing program */ - GLuint TextureStateTimestamp; /* detect changes to shared state */ + 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 */ @@ -3097,6 +3000,12 @@ struct __GLcontextRec /** software compression/decompression supported or not */ GLboolean Mesa_DXTn; + /** + * Use dp4 (rather than mul/mad) instructions for position + * transformation? + */ + GLboolean mvp_with_dp4; + /** Core tnl module support */ struct gl_tnl_module TnlModule; @@ -3110,7 +3019,7 @@ struct __GLcontextRec void *swsetup_context; void *swtnl_context; void *swtnl_im; - void *acache_context; + struct st_context *st; void *aelt_context; /*@}*/ }; @@ -3148,8 +3057,6 @@ enum _verbose VERBOSE_PRIMS = 0x0400, VERBOSE_VERTS = 0x0800, VERBOSE_DISASSEM = 0x1000, - VERBOSE_GLSL = 0x2000, - VERBOSE_GLSL_DUMP = 0x4000 }; @@ -3160,7 +3067,4 @@ enum _debug -#define Elements(x) sizeof(x)/sizeof(*(x)) - - -#endif /* TYPES_H */ +#endif /* MTYPES_H */ diff --git a/mesa/main/depthstencil.h b/mesa/main/polygon.h index 3dde081..78e8394 100644 --- a/mesa/main/depthstencil.h +++ b/mesa/main/polygon.h @@ -1,6 +1,11 @@ +/** + * \file polygon.h + * Polygon operations. + */ + /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.1 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -23,34 +28,39 @@ */ -#ifndef DEPTHSTENCIL_H -#define DEPTHSTENCIL_H +#ifndef POLYGON_H +#define POLYGON_H -extern struct gl_renderbuffer * -_mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx, - struct gl_renderbuffer *dsrb); +#include "mtypes.h" -extern struct gl_renderbuffer * -_mesa_new_s8_renderbuffer_wrapper(GLcontext *ctx, - struct gl_renderbuffer *dsrb); +extern void +_mesa_polygon_stipple(GLcontext *ctx, const GLubyte *pattern); -extern void -_mesa_extract_stencil(GLcontext *ctx, - struct gl_renderbuffer *dsRb, - struct gl_renderbuffer *stencilRb); +extern void GLAPIENTRY +_mesa_CullFace( GLenum mode ); +extern void GLAPIENTRY +_mesa_FrontFace( GLenum mode ); -extern void -_mesa_insert_stencil(GLcontext *ctx, - struct gl_renderbuffer *dsRb, - struct gl_renderbuffer *stencilRb); +extern void GLAPIENTRY +_mesa_PolygonMode( GLenum face, GLenum mode ); +extern void GLAPIENTRY +_mesa_PolygonOffset( GLfloat factor, GLfloat units ); -extern void -_mesa_promote_stencil(GLcontext *ctx, struct gl_renderbuffer *stencilRb); +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 /* DEPTHSTENCIL_H */ +#endif diff --git a/mesa/main/state.h b/mesa/main/state.h index bb7cb8f..29db08a 100644 --- a/mesa/main/state.h +++ b/mesa/main/state.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.3 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * @@ -29,13 +29,21 @@ #include "mtypes.h" extern void -_mesa_update_state( GLcontext *ctx ); +_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 ); +_mesa_update_state_locked(GLcontext *ctx); + + +extern void +_mesa_set_varying_vp_inputs(GLcontext *ctx, GLbitfield varying_inputs); + + +extern void +_mesa_set_vp_override(GLcontext *ctx, GLboolean flag); #endif diff --git a/mesa/main/texenv.h b/mesa/main/texenv.h index bdff7fd..1e9c5fa 100644 --- a/mesa/main/texenv.h +++ b/mesa/main/texenv.h @@ -48,5 +48,16 @@ _mesa_TexEnvi( GLenum target, GLenum pname, GLint param ); extern void GLAPIENTRY _mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ); +extern void GLAPIENTRY +_mesa_TexBumpParameterivATI( GLenum pname, const GLint *param ); + +extern void GLAPIENTRY +_mesa_TexBumpParameterfvATI( GLenum pname, const GLfloat *param ); + +extern void GLAPIENTRY +_mesa_GetTexBumpParameterivATI( GLenum pname, GLint *param ); + +extern void GLAPIENTRY +_mesa_GetTexBumpParameterfvATI( GLenum pname, GLfloat *param ); #endif /* TEXENV_H */ diff --git a/mesa/main/texformat.h b/mesa/main/texformat.h index b1604d4..5aa1d75 100644 --- a/mesa/main/texformat.h +++ b/mesa/main/texformat.h @@ -3,6 +3,7 @@ * Version: 6.5.1 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (c) 2008 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -98,9 +99,15 @@ enum _format { /*@{*/ MESA_FORMAT_SRGB8, MESA_FORMAT_SRGBA8, + MESA_FORMAT_SARGB8, MESA_FORMAT_SL8, MESA_FORMAT_SLA8, +#if FEATURE_texture_s3tc MESA_FORMAT_SRGB_DXT1, + MESA_FORMAT_SRGBA_DXT1, + MESA_FORMAT_SRGBA_DXT3, + MESA_FORMAT_SRGBA_DXT5, +#endif /*@}*/ #endif @@ -108,12 +115,16 @@ enum _format { * \name Compressed texture formats. */ /*@{*/ +#if FEATURE_texture_fxt1 MESA_FORMAT_RGB_FXT1, MESA_FORMAT_RGBA_FXT1, +#endif +#if FEATURE_texture_s3tc MESA_FORMAT_RGB_DXT1, MESA_FORMAT_RGBA_DXT1, MESA_FORMAT_RGBA_DXT3, MESA_FORMAT_RGBA_DXT5, +#endif /*@}*/ /** @@ -150,7 +161,16 @@ enum _format { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, MESA_FORMAT_INTENSITY_FLOAT32, - MESA_FORMAT_INTENSITY_FLOAT16 + MESA_FORMAT_INTENSITY_FLOAT16, + /*@}*/ + + /** + * \name Signed fixed point texture formats. + */ + /*@{*/ + MESA_FORMAT_DUDV8, + MESA_FORMAT_SIGNED_RGBA8888, + MESA_FORMAT_SIGNED_RGBA8888_REV /*@}*/ }; @@ -170,9 +190,15 @@ extern const struct gl_texture_format _mesa_texformat_intensity; /*@{*/ 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_sargb8; extern const struct gl_texture_format _mesa_texformat_sl8; extern const struct gl_texture_format _mesa_texformat_sla8; +#if FEATURE_texture_s3tc extern const struct gl_texture_format _mesa_texformat_srgb_dxt1; +extern const struct gl_texture_format _mesa_texformat_srgba_dxt1; +extern const struct gl_texture_format _mesa_texformat_srgba_dxt3; +extern const struct gl_texture_format _mesa_texformat_srgba_dxt5; +#endif /*@}*/ #endif @@ -192,6 +218,13 @@ extern const struct gl_texture_format _mesa_texformat_intensity_float32; extern const struct gl_texture_format _mesa_texformat_intensity_float16; /*@}*/ +/** Signed fixed point texture formats */ +/*@{*/ +extern const struct gl_texture_format _mesa_texformat_dudv8; +extern const struct gl_texture_format _mesa_texformat_signed_rgba8888; +extern const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev; +/*@}*/ + /** \name Assorted hardware-friendly formats */ /*@{*/ extern const struct gl_texture_format _mesa_texformat_rgba8888; @@ -229,12 +262,16 @@ extern const struct gl_texture_format _mesa_texformat_ycbcr_rev; /** \name Compressed formats */ /*@{*/ +#if FEATURE_texture_fxt1 extern const struct gl_texture_format _mesa_texformat_rgb_fxt1; extern const struct gl_texture_format _mesa_texformat_rgba_fxt1; +#endif +#if FEATURE_texture_s3tc 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; +#endif /*@}*/ /** \name The null format */ diff --git a/mesa/main/texgetimage.h b/mesa/main/texgetimage.h new file mode 100644 index 0000000..01f486e --- /dev/null +++ b/mesa/main/texgetimage.h @@ -0,0 +1,46 @@ +/* + * Mesa 3-D graphics library + * Version: 7.5 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2009 VMware, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION 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 TEXGETIMAGE_H +#define TEXGETIMAGE_H + + +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); + + + +#endif /* TEXGETIMAGE_H */ diff --git a/mesa/main/texobj.h b/mesa/main/texobj.h index d5374c5..2599c08 100644 --- a/mesa/main/texobj.h +++ b/mesa/main/texobj.h @@ -65,6 +65,9 @@ extern void _mesa_test_texobj_completeness( const GLcontext *ctx, struct gl_texture_object *obj ); +extern struct gl_texture_object * +_mesa_get_fallback_texture(GLcontext *ctx); + extern void _mesa_unlock_context_textures( GLcontext *ctx ); diff --git a/mesa/main/texstore.h b/mesa/main/texstore.h index 951d0a1..313f2d6 100644 --- a/mesa/main/texstore.h +++ b/mesa/main/texstore.h @@ -3,6 +3,7 @@ * Version: 6.5.1 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (c) 2008 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -73,10 +74,12 @@ 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_sargb8(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS); #endif - +extern GLboolean _mesa_texstore_dudv8(TEXSTORE_PARAMS); +extern GLboolean _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS); extern GLchan * _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, @@ -207,19 +210,6 @@ _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target, 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, diff --git a/mesa/main/varray.h b/mesa/main/varray.h index 6385689..97d5c82 100644 --- a/mesa/main/varray.h +++ b/mesa/main/varray.h @@ -156,6 +156,20 @@ _mesa_LockArraysEXT(GLint first, GLsizei count); extern void GLAPIENTRY _mesa_UnlockArraysEXT( void ); + +extern void GLAPIENTRY +_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count); + +extern void GLAPIENTRY +_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices); + +extern void GLAPIENTRY +_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, + GLenum type, const GLvoid *indices); + + + extern void _mesa_init_varray( GLcontext * ctx ); diff --git a/mesa/main/viewport.h b/mesa/main/viewport.h new file mode 100644 index 0000000..f08fef2 --- /dev/null +++ b/mesa/main/viewport.h @@ -0,0 +1,52 @@ +/* + * 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. + */ + + +#ifndef VIEWPORT_H +#define VIEWPORT_H + + +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_viewport(GLcontext *ctx); + + +extern void +_mesa_free_viewport_data(GLcontext *ctx); + + +#endif |