diff options
author | brianp <brianp> | 2002-06-14 03:55:04 +0000 |
---|---|---|
committer | brianp <brianp> | 2002-06-14 03:55:04 +0000 |
commit | a3efa72d01a584ab72c144b930e9c6dc34164177 (patch) | |
tree | d9d315b07bf8255a2635caec99d1ddc40b670b20 /xc/extras/Mesa/src | |
parent | fded8b9294d97eaa3d1cbfc12fd548af87385236 (diff) |
Sync with Mesa 4.0.3 sources.
Mostly whitespace/comment changes.
Update X11 driver since SetDrawBuffer() no longer returns GLboolean.
Diffstat (limited to 'xc/extras/Mesa/src')
27 files changed, 518 insertions, 408 deletions
diff --git a/xc/extras/Mesa/src/OSmesa/osmesa.c b/xc/extras/Mesa/src/OSmesa/osmesa.c index 458bb850c..a0fe13fb8 100644 --- a/xc/extras/Mesa/src/OSmesa/osmesa.c +++ b/xc/extras/Mesa/src/OSmesa/osmesa.c @@ -673,7 +673,9 @@ do { \ static void set_draw_buffer( GLcontext *ctx, GLenum mode ) { + /* A no-op since there's only one color buffer! */ (void) ctx; + (void) mode; } diff --git a/xc/extras/Mesa/src/X/xm_dd.c b/xc/extras/Mesa/src/X/xm_dd.c index 7f26bf757..1d01bcaf0 100644 --- a/xc/extras/Mesa/src/X/xm_dd.c +++ b/xc/extras/Mesa/src/X/xm_dd.c @@ -1,7 +1,7 @@ /* * Mesa 3-D graphics library - * Version: 4.0.2 + * Version: 4.0.3 * * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * @@ -114,9 +114,7 @@ flush( GLcontext *ctx ) } - - -static GLboolean +static void set_draw_buffer( GLcontext *ctx, GLenum mode ) { const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; @@ -124,7 +122,6 @@ set_draw_buffer( GLcontext *ctx, GLenum mode ) /* write to front buffer */ xmesa->xm_buffer->buffer = xmesa->xm_buffer->frontbuffer; xmesa_update_span_funcs(ctx); - return GL_TRUE; } else if (mode==GL_BACK_LEFT && xmesa->xm_buffer->db_state) { /* write to back buffer */ @@ -140,10 +137,11 @@ set_draw_buffer( GLcontext *ctx, GLenum mode ) xmesa->xm_buffer->buffer = xmesa->xm_buffer->frontbuffer; } xmesa_update_span_funcs(ctx); - return GL_TRUE; } else { - return GL_FALSE; + /* the swrast->_RasterMask MULTI_DRAW_BIT will be set and + * we'll fall back to swrast to draw points/lines/triangles. + */ } } @@ -230,7 +228,6 @@ index_mask( GLcontext *ctx, GLuint mask ) else { m = (unsigned long) mask; } - XMesaSetPlaneMask( xmesa->display, xmesa->xm_buffer->gc, m ); XMesaSetPlaneMask( xmesa->display, xmesa->xm_buffer->cleargc, m ); } } @@ -256,7 +253,6 @@ color_mask(GLcontext *ctx, if (gmask) m |= GET_GREENMASK(xmesa->xm_visual); if (bmask) m |= GET_BLUEMASK(xmesa->xm_visual); } - XMesaSetPlaneMask( xmesa->display, xmesa->xm_buffer->gc, m ); XMesaSetPlaneMask( xmesa->display, xmesa->xm_buffer->cleargc, m ); } } diff --git a/xc/extras/Mesa/src/X/xm_line.c b/xc/extras/Mesa/src/X/xm_line.c index a4d440faa..f231fe279 100644 --- a/xc/extras/Mesa/src/X/xm_line.c +++ b/xc/extras/Mesa/src/X/xm_line.c @@ -559,6 +559,7 @@ static swrast_line_func get_line_func( GLcontext *ctx ) if (ctx->Texture._ReallyEnabled) return (swrast_line_func) NULL; if (ctx->Light.ShadeModel != GL_FLAT) return (swrast_line_func) NULL; if (ctx->Line.StippleFlag) return (swrast_line_func) NULL; + if (swrast->_RasterMask & MULTI_DRAW_BIT) return (swrast_line_func) NULL; if (xmesa->xm_buffer->buffer==XIMAGE && swrast->_RasterMask==DEPTH_BIT diff --git a/xc/extras/Mesa/src/X/xm_tri.c b/xc/extras/Mesa/src/X/xm_tri.c index b5efc1f8e..c4b561298 100644 --- a/xc/extras/Mesa/src/X/xm_tri.c +++ b/xc/extras/Mesa/src/X/xm_tri.c @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0.3 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -1504,7 +1504,6 @@ static const char *triFuncName = NULL; #define USE(triFunc) \ do { \ triFuncName = #triFunc; \ - /*printf("%s\n", triFuncName);*/ \ return triFunc; \ } while (0) @@ -1530,6 +1529,7 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL; if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL; if (ctx->Texture._ReallyEnabled) return (swrast_tri_func) NULL; + if (swrast->_RasterMask & MULTI_DRAW_BIT) return (swrast_tri_func) NULL; if (xmesa->xm_buffer->buffer==XIMAGE) { if ( ctx->Light.ShadeModel==GL_SMOOTH diff --git a/xc/extras/Mesa/src/X86/assyntax.h b/xc/extras/Mesa/src/X86/assyntax.h index ebfe593fb..0fb0315ac 100644 --- a/xc/extras/Mesa/src/X86/assyntax.h +++ b/xc/extras/Mesa/src/X86/assyntax.h @@ -990,12 +990,21 @@ SECTION _DATA public align=16 class=DATA use32 flat #define B_CONST(a) a /* Indirect Mode */ +#ifdef NASM_ASSEMBLER +#define P_CONTENT(a) [a] +#define X_CONTENT(a) TBYTE_PTR [a] +#define D_CONTENT(a) QWORD_PTR [a] +#define L_CONTENT(a) DWORD_PTR [a] +#define W_CONTENT(a) WORD_PTR [a] +#define B_CONTENT(a) BYTE_PTR [a] +#else #define P_CONTENT(a) a #define X_CONTENT(a) TBYTE_PTR a #define D_CONTENT(a) QWORD_PTR a #define L_CONTENT(a) DWORD_PTR a #define W_CONTENT(a) WORD_PTR a #define B_CONTENT(a) BYTE_PTR a +#endif /* Register a indirect */ #define P_REGIND(a) [a] diff --git a/xc/extras/Mesa/src/X86/common_x86_asm.S b/xc/extras/Mesa/src/X86/common_x86_asm.S index c2e6d971b..9402cbcc0 100644 --- a/xc/extras/Mesa/src/X86/common_x86_asm.S +++ b/xc/extras/Mesa/src/X86/common_x86_asm.S @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0.3 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -201,7 +201,7 @@ GLNAME( _mesa_test_os_sse_exception_support ): LDMXCSR ( REGOFF( -8, EBP ) ) XORPS ( XMM0, XMM0 ) - MOVUPS ( GLNAME( sse_test_dummy ), XMM1 ) + MOVUPS ( CONTENT( GLNAME( sse_test_dummy ) ), XMM1 ) DIVPS ( XMM0, XMM1 ) diff --git a/xc/extras/Mesa/src/api_arrayelt.c b/xc/extras/Mesa/src/api_arrayelt.c index 0f7f385f3..4ebfb59dc 100644 --- a/xc/extras/Mesa/src/api_arrayelt.c +++ b/xc/extras/Mesa/src/api_arrayelt.c @@ -282,7 +282,7 @@ static void _ae_update_state( GLcontext *ctx ) ta->array = &ctx->Array.TexCoord[i]; ta->func = multitexfuncs[ta->array->Size-1][TYPE_IDX(ta->array->Type)]; ta++; - } + } ta->func = 0; diff --git a/xc/extras/Mesa/src/colortab.c b/xc/extras/Mesa/src/colortab.c index cf13032b4..9ca9576e9 100644 --- a/xc/extras/Mesa/src/colortab.c +++ b/xc/extras/Mesa/src/colortab.c @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0.3 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -212,6 +212,14 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, texObj = texUnit->Current3D; table = &texObj->Palette; break; + case GL_TEXTURE_CUBE_MAP_ARB: + if (!ctx->Extensions.ARB_texture_cube_map) { + _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)"); + return; + } + texObj = texUnit->CurrentCubeMap; + table = &texObj->Palette; + break; case GL_PROXY_TEXTURE_1D: texObj = ctx->Texture.Proxy1D; table = &texObj->Palette; @@ -227,6 +235,14 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, table = &texObj->Palette; proxy = GL_TRUE; break; + case GL_PROXY_TEXTURE_CUBE_MAP_ARB: + if (!ctx->Extensions.ARB_texture_cube_map) { + _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)"); + return; + } + texObj = ctx->Texture.ProxyCubeMap; + table = &texObj->Palette; + break; case GL_SHARED_TEXTURE_PALETTE_EXT: table = &ctx->Texture.Palette; break; @@ -455,6 +471,14 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, texObj = texUnit->Current3D; table = &texObj->Palette; break; + case GL_TEXTURE_CUBE_MAP_ARB: + if (!ctx->Extensions.ARB_texture_cube_map) { + _mesa_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)"); + return; + } + texObj = texUnit->CurrentCubeMap; + table = &texObj->Palette; + break; case GL_SHARED_TEXTURE_PALETTE_EXT: table = &ctx->Texture.Palette; break; @@ -653,6 +677,13 @@ _mesa_GetColorTable( GLenum target, GLenum format, case GL_TEXTURE_3D: table = &texUnit->Current3D->Palette; break; + case GL_TEXTURE_CUBE_MAP_ARB: + if (!ctx->Extensions.ARB_texture_cube_map) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)"); + return; + } + table = &texUnit->CurrentCubeMap->Palette; + break; case GL_SHARED_TEXTURE_PALETTE_EXT: table = &ctx->Texture.Palette; break; @@ -927,6 +958,14 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) case GL_TEXTURE_3D: table = &texUnit->Current3D->Palette; break; + case GL_TEXTURE_CUBE_MAP_ARB: + if (!ctx->Extensions.ARB_texture_cube_map) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetColorTableParameterfv(target)"); + return; + } + table = &texUnit->CurrentCubeMap->Palette; + break; case GL_PROXY_TEXTURE_1D: table = &ctx->Texture.Proxy1D->Palette; break; @@ -936,6 +975,14 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) case GL_PROXY_TEXTURE_3D: table = &ctx->Texture.Proxy3D->Palette; break; + case GL_PROXY_TEXTURE_CUBE_MAP_ARB: + if (!ctx->Extensions.ARB_texture_cube_map) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetColorTableParameterfv(target)"); + return; + } + table = &ctx->Texture.ProxyCubeMap->Palette; + break; case GL_SHARED_TEXTURE_PALETTE_EXT: table = &ctx->Texture.Palette; break; @@ -1057,6 +1104,14 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) case GL_TEXTURE_3D: table = &texUnit->Current3D->Palette; break; + case GL_TEXTURE_CUBE_MAP_ARB: + if (!ctx->Extensions.ARB_texture_cube_map) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetColorTableParameteriv(target)"); + return; + } + table = &texUnit->CurrentCubeMap->Palette; + break; case GL_PROXY_TEXTURE_1D: table = &ctx->Texture.Proxy1D->Palette; break; @@ -1066,6 +1121,14 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) case GL_PROXY_TEXTURE_3D: table = &ctx->Texture.Proxy3D->Palette; break; + case GL_PROXY_TEXTURE_CUBE_MAP_ARB: + if (!ctx->Extensions.ARB_texture_cube_map) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetColorTableParameteriv(target)"); + return; + } + table = &ctx->Texture.ProxyCubeMap->Palette; + break; case GL_SHARED_TEXTURE_PALETTE_EXT: table = &ctx->Texture.Palette; break; diff --git a/xc/extras/Mesa/src/context.c b/xc/extras/Mesa/src/context.c index 1ca549958..ea344c8b1 100644 --- a/xc/extras/Mesa/src/context.c +++ b/xc/extras/Mesa/src/context.c @@ -1,7 +1,7 @@ /* * Mesa 3-D graphics library - * Version: 4.0.2 + * Version: 4.0.3 * * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * diff --git a/xc/extras/Mesa/src/dd.h b/xc/extras/Mesa/src/dd.h index 29fb9b0c3..b0b9dba24 100644 --- a/xc/extras/Mesa/src/dd.h +++ b/xc/extras/Mesa/src/dd.h @@ -1,8 +1,9 @@ + /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0.3 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/xc/extras/Mesa/src/glheader.h b/xc/extras/Mesa/src/glheader.h index 0d6326efe..78f618949 100644 --- a/xc/extras/Mesa/src/glheader.h +++ b/xc/extras/Mesa/src/glheader.h @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0.3 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -161,6 +161,27 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC #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 ) +#else /*__linux__*/ +#define CPU_TO_LE32( x ) ( x ) /* fix me for non-Linux big-endian! */ +#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 ) + + /* This is a macro on IRIX */ #ifdef _P #undef _P @@ -261,11 +282,4 @@ typedef union { GLfloat f; GLint i; } fi_type; -#ifndef GL_MIRRORED_REPEAT_ARB -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#endif -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -#endif - #endif /* GLHEADER_H */ diff --git a/xc/extras/Mesa/src/macros.h b/xc/extras/Mesa/src/macros.h index 7dbd30992..b3502b609 100644 --- a/xc/extras/Mesa/src/macros.h +++ b/xc/extras/Mesa/src/macros.h @@ -453,20 +453,8 @@ do { \ -/* Byte swapping - */ - -#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN -#include <byteswap.h> -#define CPU_TO_LE32( x ) bswap_32( x ) -#else -#define CPU_TO_LE32( x ) ( x ) -#endif - -#define LE32_TO_CPU( x ) CPU_TO_LE32( x ) - - -/* Generic color packing macros +/* Generic color packing macros. + * XXX We may move these into texutil.h at some point. */ #define PACK_COLOR_8888( a, b, c, d ) \ @@ -492,7 +480,7 @@ do { \ (((a) & 0xe0) | (((b) & 0xe0) >> 3) | (((c) & 0xc0) >> 6)) -#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN +#ifdef MESA_BIG_ENDIAN #define PACK_COLOR_8888_LE( a, b, c, d ) PACK_COLOR_8888( d, c, b, a ) diff --git a/xc/extras/Mesa/src/math/m_clip_tmp.h b/xc/extras/Mesa/src/math/m_clip_tmp.h index 8c21fcf21..3f84f9393 100644 --- a/xc/extras/Mesa/src/math/m_clip_tmp.h +++ b/xc/extras/Mesa/src/math/m_clip_tmp.h @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0.3 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/xc/extras/Mesa/src/matrix.c b/xc/extras/Mesa/src/matrix.c index 4f9e2eea2..c97b28951 100644 --- a/xc/extras/Mesa/src/matrix.c +++ b/xc/extras/Mesa/src/matrix.c @@ -1,4 +1,4 @@ - + /* * Mesa 3-D graphics library * Version: 3.5 diff --git a/xc/extras/Mesa/src/mmath.h b/xc/extras/Mesa/src/mmath.h index cbf3152ce..ea2aa7bc5 100644 --- a/xc/extras/Mesa/src/mmath.h +++ b/xc/extras/Mesa/src/mmath.h @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 4.0 + * Version: 4.0.3 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -198,8 +198,9 @@ do { \ #endif -#if defined(__i386__) || defined(__sparc__) || defined(__s390x__) || defined(__powerpc__) || \ - ( defined(__alpha__) && ( defined( __IEEE_FLOAT ) || !defined( VMS ) ) ) +#if defined(__i386__) || defined(__sparc__) || defined(__s390x__) || \ + defined(__powerpc__) || \ + ( defined(__alpha__) && ( defined(__IEEE_FLOAT) || !defined(VMS) ) ) #define USE_IEEE #endif diff --git a/xc/extras/Mesa/src/mtypes.h b/xc/extras/Mesa/src/mtypes.h index 1fbcb8b49..4fe498f04 100644 --- a/xc/extras/Mesa/src/mtypes.h +++ b/xc/extras/Mesa/src/mtypes.h @@ -668,6 +668,8 @@ struct gl_stencil_attrib { #define R_BIT 4 #define Q_BIT 8 +#define NUM_TEXTURE_TARGETS 4 /* 1D, 2D, 3D and CUBE */ + /* Texture Enabled flags */ #define TEXTURE0_1D 0x1 /* Texture unit 0 (default) */ #define TEXTURE0_2D 0x2 @@ -1673,7 +1675,7 @@ do { \ #define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval) \ do { \ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \ - _mesa_error( ctx, GL_INVALID_OPERATION, __FUNCTION__ ); \ + _mesa_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \ return retval; \ } \ } while (0) @@ -1681,7 +1683,7 @@ do { \ #define ASSERT_OUTSIDE_BEGIN_END(ctx) \ do { \ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \ - _mesa_error( ctx, GL_INVALID_OPERATION, __FUNCTION__ ); \ + _mesa_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \ return; \ } \ } while (0) diff --git a/xc/extras/Mesa/src/state.c b/xc/extras/Mesa/src/state.c index e77dc152b..a611fdb12 100644 --- a/xc/extras/Mesa/src/state.c +++ b/xc/extras/Mesa/src/state.c @@ -800,7 +800,7 @@ update_texture_state( GLcontext *ctx ) } { - GLuint flag = texUnit->_ReallyEnabled << (i * 4); + GLuint flag = texUnit->_ReallyEnabled << (i * NUM_TEXTURE_TARGETS); ctx->Texture._ReallyEnabled |= flag; } diff --git a/xc/extras/Mesa/src/swrast/s_texture.c b/xc/extras/Mesa/src/swrast/s_texture.c index 88083180e..9b985cae2 100644 --- a/xc/extras/Mesa/src/swrast/s_texture.c +++ b/xc/extras/Mesa/src/swrast/s_texture.c @@ -2982,7 +2982,7 @@ _swrast_texture_fragments( GLcontext *ctx, GLuint texUnit, GLuint n, const GLfloat r[], GLfloat lambda[], CONST GLchan primary_rgba[][4], GLchan rgba[][4] ) { - const GLuint mask = TEXTURE0_ANY << (texUnit * 4); + const GLuint mask = TEXTURE0_ANY << (texUnit * NUM_TEXTURE_TARGETS); if (ctx->Texture._ReallyEnabled & mask) { const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit]; diff --git a/xc/extras/Mesa/src/swrast_setup/ss_vb.c b/xc/extras/Mesa/src/swrast_setup/ss_vb.c index 9c7b42cc9..05d6e570b 100644 --- a/xc/extras/Mesa/src/swrast_setup/ss_vb.c +++ b/xc/extras/Mesa/src/swrast_setup/ss_vb.c @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0.3 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -385,9 +385,9 @@ _swsetup_choose_rastersetup_func(GLcontext *ctx) if (ctx->Visual.rgbMode) { funcindex = COLOR; - if (ctx->Texture._ReallyEnabled & ~0xf) + if (ctx->Texture._ReallyEnabled & ~TEXTURE0_ANY) funcindex |= MULTITEX; - else if (ctx->Texture._ReallyEnabled & 0xf) + else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) funcindex |= TEX0; if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) diff --git a/xc/extras/Mesa/src/texformat.h b/xc/extras/Mesa/src/texformat.h index fbe1a6538..72b473cdf 100644 --- a/xc/extras/Mesa/src/texformat.h +++ b/xc/extras/Mesa/src/texformat.h @@ -69,7 +69,7 @@ enum _format { * * NOTE: Because these are based on the GLchan datatype, one cannot * assume 8 bits per channel with these formats. If you require - * GLubyte per channel, use one of the hardware formats below. + * GLubyte per channel, use one of the hardware formats above. */ MESA_FORMAT_RGBA, MESA_FORMAT_RGB, diff --git a/xc/extras/Mesa/src/teximage.c b/xc/extras/Mesa/src/teximage.c index fd50936b9..57bd7b528 100644 --- a/xc/extras/Mesa/src/teximage.c +++ b/xc/extras/Mesa/src/teximage.c @@ -977,7 +977,7 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions, _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexImage2D(target)" ); return GL_TRUE; } - if (target == GL_PROXY_TEXTURE_2D && target == GL_TEXTURE_2D) + if (target == GL_TEXTURE_2D) maxLevels = ctx->Const.MaxTextureLevels; else maxLevels = ctx->Const.MaxCubeTextureLevels; @@ -1075,7 +1075,7 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions, _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage2D(target)" ); return GL_TRUE; } - if (target == GL_PROXY_TEXTURE_2D && target == GL_TEXTURE_2D) + if (target == GL_TEXTURE_2D) maxLevels = ctx->Const.MaxTextureLevels; else maxLevels = ctx->Const.MaxCubeTextureLevels; diff --git a/xc/extras/Mesa/src/texstate.c b/xc/extras/Mesa/src/texstate.c index da998b797..ece08a1e6 100644 --- a/xc/extras/Mesa/src/texstate.c +++ b/xc/extras/Mesa/src/texstate.c @@ -488,176 +488,191 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; ASSERT_OUTSIDE_BEGIN_END(ctx); - if (target!=GL_TEXTURE_ENV) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); - return; + if (target == GL_TEXTURE_ENV) { + switch (pname) { + case GL_TEXTURE_ENV_MODE: + *params = ENUM_TO_FLOAT(texUnit->EnvMode); + break; + case GL_TEXTURE_ENV_COLOR: + COPY_4FV( params, texUnit->EnvColor ); + break; + case GL_COMBINE_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineModeRGB; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_COMBINE_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineModeA; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE0_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineSourceRGB[0]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE1_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineSourceRGB[1]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE2_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineSourceRGB[2]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE0_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineSourceA[0]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE1_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineSourceA[1]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE2_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineSourceA[2]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND0_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineOperandRGB[0]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND1_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineOperandRGB[1]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND2_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineOperandRGB[2]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND0_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineOperandA[0]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND1_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineOperandA[1]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND2_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->CombineOperandA[2]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_RGB_SCALE_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + if (texUnit->CombineScaleShiftRGB == 0) + *params = 1.0; + else if (texUnit->CombineScaleShiftRGB == 1) + *params = 2.0; + else + *params = 4.0; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + return; + } + break; + case GL_ALPHA_SCALE: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + if (texUnit->CombineScaleShiftA == 0) + *params = 1.0; + else if (texUnit->CombineScaleShiftA == 1) + *params = 2.0; + else + *params = 4.0; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + return; + } + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" ); + } } - - switch (pname) { - case GL_TEXTURE_ENV_MODE: - *params = ENUM_TO_FLOAT(texUnit->EnvMode); - break; - case GL_TEXTURE_ENV_COLOR: - COPY_4FV( params, texUnit->EnvColor ); - break; - case GL_COMBINE_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineModeRGB; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_COMBINE_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineModeA; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE0_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineSourceRGB[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE1_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineSourceRGB[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE2_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineSourceRGB[2]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE0_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineSourceA[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE1_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineSourceA[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE2_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineSourceA[2]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND0_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineOperandRGB[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND1_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineOperandRGB[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND2_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineOperandRGB[2]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND0_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineOperandA[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND1_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineOperandA[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND2_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->CombineOperandA[2]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_RGB_SCALE_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->CombineScaleShiftRGB == 0) - *params = 1.0; - else if (texUnit->CombineScaleShiftRGB == 1) - *params = 2.0; - else - *params = 4.0; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - return; - } - break; - case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->CombineScaleShiftA == 0) - *params = 1.0; - else if (texUnit->CombineScaleShiftA == 1) - *params = 2.0; - else - *params = 4.0; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - return; - } - break; - default: + else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { + /* GL_EXT_texture_lod_bias */ + if (!ctx->Extensions.EXT_texture_lod_bias) { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); + return; + } + if (pname == GL_TEXTURE_LOD_BIAS_EXT) { + *params = texUnit->LodBias; + } + else { _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" ); + return; + } + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); + return; } } @@ -674,174 +689,194 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) return; } - switch (pname) { - case GL_TEXTURE_ENV_MODE: - *params = (GLint) texUnit->EnvMode; - break; - case GL_TEXTURE_ENV_COLOR: - params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] ); - params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] ); - params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] ); - params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] ); - break; - case GL_COMBINE_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineModeRGB; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_COMBINE_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineModeA; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_SOURCE0_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineSourceRGB[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_SOURCE1_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineSourceRGB[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_SOURCE2_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineSourceRGB[2]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_SOURCE0_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineSourceA[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_SOURCE1_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineSourceA[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_SOURCE2_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineSourceA[2]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_OPERAND0_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineOperandRGB[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_OPERAND1_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineOperandRGB[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_OPERAND2_RGB_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineOperandRGB[2]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_OPERAND0_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineOperandA[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_OPERAND1_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineOperandA[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_OPERAND2_ALPHA_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->CombineOperandA[2]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_RGB_SCALE_EXT: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->CombineScaleShiftRGB == 0) - *params = 1; - else if (texUnit->CombineScaleShiftRGB == 1) - *params = 2; - else - *params = 4; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - return; - } - break; - case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->CombineScaleShiftA == 0) - *params = 1; - else if (texUnit->CombineScaleShiftA == 1) - *params = 2; - else - *params = 4; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - return; - } - break; - default: + if (target == GL_TEXTURE_ENV) { + switch (pname) { + case GL_TEXTURE_ENV_MODE: + *params = (GLint) texUnit->EnvMode; + break; + case GL_TEXTURE_ENV_COLOR: + params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] ); + params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] ); + params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] ); + params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] ); + break; + case GL_COMBINE_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineModeRGB; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_COMBINE_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineModeA; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_SOURCE0_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineSourceRGB[0]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_SOURCE1_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineSourceRGB[1]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_SOURCE2_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineSourceRGB[2]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_SOURCE0_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineSourceA[0]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_SOURCE1_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineSourceA[1]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_SOURCE2_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineSourceA[2]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_OPERAND0_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineOperandRGB[0]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_OPERAND1_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineOperandRGB[1]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_OPERAND2_RGB_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineOperandRGB[2]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_OPERAND0_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineOperandA[0]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_OPERAND1_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineOperandA[1]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_OPERAND2_ALPHA_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->CombineOperandA[2]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_RGB_SCALE_EXT: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + if (texUnit->CombineScaleShiftRGB == 0) + *params = 1; + else if (texUnit->CombineScaleShiftRGB == 1) + *params = 2; + else + *params = 4; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + return; + } + break; + case GL_ALPHA_SCALE: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + if (texUnit->CombineScaleShiftA == 0) + *params = 1; + else if (texUnit->CombineScaleShiftA == 1) + *params = 2; + else + *params = 4; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + return; + } + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" ); + } + } + else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { + /* GL_EXT_texture_lod_bias */ + if (!ctx->Extensions.EXT_texture_lod_bias) { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); + return; + } + if (pname == GL_TEXTURE_LOD_BIAS_EXT) { + *params = (GLint) texUnit->LodBias; + } + else { _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" ); + return; + } + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); + return; } } diff --git a/xc/extras/Mesa/src/texutil.c b/xc/extras/Mesa/src/texutil.c index 33c20d5ab..bf9285a7e 100644 --- a/xc/extras/Mesa/src/texutil.c +++ b/xc/extras/Mesa/src/texutil.c @@ -43,7 +43,7 @@ #define DEBUG_TEXUTIL 0 -#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN +#ifdef MESA_BIG_ENDIAN #define APPEND16( a, b ) ( (a) << 16 | (b) ) #else #define APPEND16( a, b ) ( (a) | (b) << 16 ) @@ -416,7 +416,7 @@ CONVERT_ARGB4444( texsubimage3d ) #include "texutil_tmp.h" -#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN +#ifdef MESA_BIG_ENDIAN #define CONVERT_TEXEL( dst, src ) \ { const GLushort s = *(GLushort *)src; \ diff --git a/xc/extras/Mesa/src/tnl/t_imm_api.c b/xc/extras/Mesa/src/tnl/t_imm_api.c index 9b6c6cf43..c2ac1d0ca 100644 --- a/xc/extras/Mesa/src/tnl/t_imm_api.c +++ b/xc/extras/Mesa/src/tnl/t_imm_api.c @@ -352,7 +352,7 @@ _tnl_end( GLcontext *ctx ) /* You can set this flag to get the old 'flush_vb on glEnd()' * behaviour. */ - if ((MESA_DEBUG_FLAGS&DEBUG_ALWAYS_FLUSH)) + if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) _tnl_flush_immediate( IM ); } diff --git a/xc/extras/Mesa/src/tnl/t_imm_dlist.c b/xc/extras/Mesa/src/tnl/t_imm_dlist.c index 257b6e47c..a7d48695b 100644 --- a/xc/extras/Mesa/src/tnl/t_imm_dlist.c +++ b/xc/extras/Mesa/src/tnl/t_imm_dlist.c @@ -366,7 +366,7 @@ execute_compiled_cassette( GLcontext *ctx, void *data ) ctx->Driver.CurrentExecPrimitive = IM->Primitive[IM->LastPrimitive] & PRIM_MODE_MASK; } - + /* fprintf(stderr, "%s: IM->Primitive[%d]: %x, CurrExecPrim: %x\n", */ /* __FUNCTION__, */ /* IM->LastPrimitive, */ diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp2.h b/xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp2.h index 928d065d5..e37631e69 100644 --- a/xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp2.h +++ b/xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp2.h @@ -1,10 +1,9 @@ -/* $Id: t_dd_dmatmp2.h,v 1.2 2002/06/12 15:50:25 keithw Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0.3 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h b/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h index 96f6bd0c3..a46bdae74 100644 --- a/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h +++ b/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0.3 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -200,7 +200,6 @@ static void TAG(emit)( GLcontext *ctx, } } - if (DO_FOG) { if (VB->FogCoordPtr) { fog = VB->FogCoordPtr->data; |