diff options
author | alanh <alanh> | 2003-12-03 19:08:52 +0000 |
---|---|---|
committer | alanh <alanh> | 2003-12-03 19:08:52 +0000 |
commit | d65f4a648a149a439db874c95783efe8a295df10 (patch) | |
tree | 325859bb1c98190414944a8177b85116e6bc5534 | |
parent | a189743544a222ae3242706325348e2a9d154c73 (diff) |
sync up with the current Mesa 5.0 branch
-rw-r--r-- | xc/extras/Mesa/src/OSmesa/osmesa.c | 3 | ||||
-rw-r--r-- | xc/extras/Mesa/src/SPARC/glapi_sparc.S | 2 | ||||
-rw-r--r-- | xc/extras/Mesa/src/X86/3dnow_normal.S | 34 | ||||
-rw-r--r-- | xc/extras/Mesa/src/X86/common_x86.c | 2 | ||||
-rw-r--r-- | xc/extras/Mesa/src/X86/common_x86_asm.S | 8 | ||||
-rw-r--r-- | xc/extras/Mesa/src/X86/common_x86_asm.h | 2 | ||||
-rw-r--r-- | xc/extras/Mesa/src/X86/glapi_x86.S | 2 | ||||
-rw-r--r-- | xc/extras/Mesa/src/accum.c | 13 | ||||
-rw-r--r-- | xc/extras/Mesa/src/math/m_debug_clip.c | 4 | ||||
-rw-r--r-- | xc/extras/Mesa/src/math/m_debug_norm.c | 3 | ||||
-rw-r--r-- | xc/extras/Mesa/src/math/m_debug_xform.c | 4 | ||||
-rw-r--r-- | xc/extras/Mesa/src/math/m_xform.c | 2 | ||||
-rw-r--r-- | xc/extras/Mesa/src/mmath.h | 2 | ||||
-rw-r--r-- | xc/extras/Mesa/src/texstore.c | 4 | ||||
-rw-r--r-- | xc/extras/Mesa/src/tnl/t_context.c | 3 | ||||
-rw-r--r-- | xc/extras/Mesa/src/tnl/t_vb_texgen.c | 28 |
16 files changed, 66 insertions, 50 deletions
diff --git a/xc/extras/Mesa/src/OSmesa/osmesa.c b/xc/extras/Mesa/src/OSmesa/osmesa.c index 748eab2c7..ddd3bd2b9 100644 --- a/xc/extras/Mesa/src/OSmesa/osmesa.c +++ b/xc/extras/Mesa/src/OSmesa/osmesa.c @@ -114,8 +114,9 @@ static void osmesa_register_swrast_functions( GLcontext *ctx ); GLAPI OSMesaContext GLAPIENTRY OSMesaCreateContext( GLenum format, OSMesaContext sharelist ) { + const GLint accumBits = (format == OSMESA_COLOR_INDEX) ? 0 : 16; return OSMesaCreateContextExt(format, DEFAULT_SOFTWARE_DEPTH_BITS, - 8, 16, sharelist); + 8, accumBits, sharelist); } diff --git a/xc/extras/Mesa/src/SPARC/glapi_sparc.S b/xc/extras/Mesa/src/SPARC/glapi_sparc.S index 738170087..fe426c65e 100644 --- a/xc/extras/Mesa/src/SPARC/glapi_sparc.S +++ b/xc/extras/Mesa/src/SPARC/glapi_sparc.S @@ -1,5 +1,5 @@ /* DO NOT EDIT - This file generated automatically with glsparcasm.py script */ -#include "glapioffsets.h" +#include "../glapioffsets.h" /* The _glapi_Dispatch symbol addresses get relocated into the * sethi/or instruction sequences below at library init time. diff --git a/xc/extras/Mesa/src/X86/3dnow_normal.S b/xc/extras/Mesa/src/X86/3dnow_normal.S index eec9be3ee..a5299fe44 100644 --- a/xc/extras/Mesa/src/X86/3dnow_normal.S +++ b/xc/extras/Mesa/src/X86/3dnow_normal.S @@ -40,7 +40,7 @@ ALIGNTEXT16 GLOBL GLNAME(_mesa_3dnow_transform_normalize_normals) GLNAME(_mesa_3dnow_transform_normalize_normals): - #define FRAME_OFFSET 12 +#define FRAME_OFFSET 12 PUSH_L ( EDI ) PUSH_L ( ESI ) @@ -66,8 +66,8 @@ GLNAME(_mesa_3dnow_transform_normalize_normals): PUSH_L ( EAX ) PUSH_L ( EDX ) /* save counter & pointer for */ /* the normalize pass */ - #undef FRAME_OFFSET - #define FRAME_OFFSET 24 +#undef FRAME_OFFSET +#define FRAME_OFFSET 24 MOVQ ( M(0), MM3 ) /* m1 | m0 */ MOVQ ( M(4), MM4 ) /* m5 | m4 */ @@ -217,8 +217,8 @@ ALIGNTEXT16 GLOBL GLNAME(_mesa_3dnow_transform_normalize_normals_no_rot) GLNAME(_mesa_3dnow_transform_normalize_normals_no_rot): - #undef FRAME_OFFSET - #define FRAME_OFFSET 12 +#undef FRAME_OFFSET +#define FRAME_OFFSET 12 PUSH_L ( EDI ) PUSH_L ( ESI ) @@ -356,8 +356,8 @@ ALIGNTEXT16 GLOBL GLNAME(_mesa_3dnow_transform_rescale_normals_no_rot) GLNAME(_mesa_3dnow_transform_rescale_normals_no_rot): - #undef FRAME_OFFSET - #define FRAME_OFFSET 12 +#undef FRAME_OFFSET +#define FRAME_OFFSET 12 PUSH_L ( EDI ) PUSH_L ( ESI ) @@ -427,8 +427,8 @@ ALIGNTEXT16 GLOBL GLNAME(_mesa_3dnow_transform_rescale_normals) GLNAME(_mesa_3dnow_transform_rescale_normals): - #undef FRAME_OFFSET - #define FRAME_OFFSET 8 +#undef FRAME_OFFSET +#define FRAME_OFFSET 8 PUSH_L ( EDI ) PUSH_L ( ESI ) @@ -524,8 +524,8 @@ ALIGNTEXT16 GLOBL GLNAME(_mesa_3dnow_transform_normals_no_rot) GLNAME(_mesa_3dnow_transform_normals_no_rot): - #undef FRAME_OFFSET - #define FRAME_OFFSET 8 +#undef FRAME_OFFSET +#define FRAME_OFFSET 8 PUSH_L ( EDI ) PUSH_L ( ESI ) @@ -590,8 +590,8 @@ ALIGNTEXT16 GLOBL GLNAME(_mesa_3dnow_transform_normals) GLNAME(_mesa_3dnow_transform_normals): - #undef FRAME_OFFSET - #define FRAME_OFFSET 8 +#undef FRAME_OFFSET +#define FRAME_OFFSET 8 PUSH_L ( EDI ) PUSH_L ( ESI ) @@ -674,8 +674,8 @@ ALIGNTEXT16 GLOBL GLNAME(_mesa_3dnow_normalize_normals) GLNAME(_mesa_3dnow_normalize_normals): - #undef FRAME_OFFSET - #define FRAME_OFFSET 12 +#undef FRAME_OFFSET +#define FRAME_OFFSET 12 PUSH_L ( EDI ) PUSH_L ( ESI ) @@ -785,8 +785,8 @@ ALIGNTEXT16 GLOBL GLNAME(_mesa_3dnow_rescale_normals) GLNAME(_mesa_3dnow_rescale_normals): - #undef FRAME_OFFSET - #define FRAME_OFFSET 8 +#undef FRAME_OFFSET +#define FRAME_OFFSET 8 PUSH_L ( EDI ) PUSH_L ( ESI ) diff --git a/xc/extras/Mesa/src/X86/common_x86.c b/xc/extras/Mesa/src/X86/common_x86.c index d4e4894aa..970b7ce82 100644 --- a/xc/extras/Mesa/src/X86/common_x86.c +++ b/xc/extras/Mesa/src/X86/common_x86.c @@ -29,7 +29,7 @@ * * Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de> * Changed by Andre Werthmann <wertmann@cs.uni-potsdam.de> for using the - * new Katmai functions. + * new SSE functions. */ #include <stdlib.h> diff --git a/xc/extras/Mesa/src/X86/common_x86_asm.S b/xc/extras/Mesa/src/X86/common_x86_asm.S index d068564f2..a6697bde5 100644 --- a/xc/extras/Mesa/src/X86/common_x86_asm.S +++ b/xc/extras/Mesa/src/X86/common_x86_asm.S @@ -112,10 +112,10 @@ GLNAME( _mesa_identify_x86_cpu_features ): CPUID MOV_L ( EDX, EAX ) - /* Mask out highest bit, which is used by AMD for 3dnow - * Newer Intel have this bit set, but do not support 3dnow - */ - AND_L ( CONST(0X7FFFFFFF), EAX) + /* Mask out highest bit, which is used by AMD for 3dnow. + * Newer Intel have this bit set, but do not support 3dnow. + */ + AND_L ( CONST(0X7FFFFFFF), EAX) JMP ( LLBL(cpuid_done) ) LLBL(cpuid_amd): diff --git a/xc/extras/Mesa/src/X86/common_x86_asm.h b/xc/extras/Mesa/src/X86/common_x86_asm.h index 46d1a4b07..511574d0b 100644 --- a/xc/extras/Mesa/src/X86/common_x86_asm.h +++ b/xc/extras/Mesa/src/X86/common_x86_asm.h @@ -29,7 +29,7 @@ * * Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de> * Changed by Andre Werthmann <wertmann@cs.uni-potsdam.de> for using the - * new Katmai functions + * new SSE functions * * Reimplemented by Gareth Hughes in a more * future-proof manner, based on code in the Linux kernel. diff --git a/xc/extras/Mesa/src/X86/glapi_x86.S b/xc/extras/Mesa/src/X86/glapi_x86.S index 57dd296c7..e10d9a06f 100644 --- a/xc/extras/Mesa/src/X86/glapi_x86.S +++ b/xc/extras/Mesa/src/X86/glapi_x86.S @@ -1,6 +1,6 @@ /* DO NOT EDIT - This file generated automatically with glx86asm.py script */ #include "assyntax.h" -#include "glapioffsets.h" +#include "../glapioffsets.h" #ifndef __WIN32__ diff --git a/xc/extras/Mesa/src/accum.c b/xc/extras/Mesa/src/accum.c index 1185adbfd..7fbdee0d2 100644 --- a/xc/extras/Mesa/src/accum.c +++ b/xc/extras/Mesa/src/accum.c @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 5.0.2 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -51,8 +50,7 @@ _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) COPY_4FV( ctx->Accum.ClearColor, tmp ); } -/* Should really be a driver-supplied function? - */ + void _mesa_Accum( GLenum op, GLfloat value ) { @@ -68,6 +66,11 @@ _mesa_Accum( GLenum op, GLfloat value ) if (ctx->NewState) _mesa_update_state( ctx ); + if (ctx->RenderMode != GL_RENDER) { + /* no-op */ + return; + } + /* Determine region to operate upon. */ if (ctx->Scissor.Enabled) { xpos = ctx->Scissor.X; diff --git a/xc/extras/Mesa/src/math/m_debug_clip.c b/xc/extras/Mesa/src/math/m_debug_clip.c index 867850c61..eff9201ca 100644 --- a/xc/extras/Mesa/src/math/m_debug_clip.c +++ b/xc/extras/Mesa/src/math/m_debug_clip.c @@ -37,6 +37,10 @@ #include "m_debug.h" #include "m_debug_util.h" +#ifdef __UNIXOS2__ +static char dummy; +#endif + #ifdef DEBUG /* This code only used for debugging */ static clip_func *clip_tab[2] = { diff --git a/xc/extras/Mesa/src/math/m_debug_norm.c b/xc/extras/Mesa/src/math/m_debug_norm.c index 4de90e3d6..bef39a720 100644 --- a/xc/extras/Mesa/src/math/m_debug_norm.c +++ b/xc/extras/Mesa/src/math/m_debug_norm.c @@ -38,6 +38,9 @@ #include "m_debug.h" #include "m_debug_util.h" +#ifdef __UNIXOS2__ +static char dummy; +#endif #ifdef DEBUG /* This code only used for debugging */ diff --git a/xc/extras/Mesa/src/math/m_debug_xform.c b/xc/extras/Mesa/src/math/m_debug_xform.c index c197d953e..576a309ee 100644 --- a/xc/extras/Mesa/src/math/m_debug_xform.c +++ b/xc/extras/Mesa/src/math/m_debug_xform.c @@ -38,6 +38,10 @@ #include "m_debug.h" #include "m_debug_util.h" +#ifdef __UNIXOS2__ +static char dummy; +#endif + #ifdef DEBUG /* This code only used for debugging */ diff --git a/xc/extras/Mesa/src/math/m_xform.c b/xc/extras/Mesa/src/math/m_xform.c index be8a74a78..1a24b12d6 100644 --- a/xc/extras/Mesa/src/math/m_xform.c +++ b/xc/extras/Mesa/src/math/m_xform.c @@ -187,7 +187,7 @@ void _mesa_transform_point_sz( GLfloat Q[4], const GLfloat M[16], /* * This is called only once. It initializes several tables with pointers * to optimized transformation functions. This is where we can test for - * AMD 3Dnow! capability, Intel Katmai, etc. and hook in the right code. + * AMD 3Dnow! capability, Intel SSE, etc. and hook in the right code. */ void _math_init_transformation( void ) diff --git a/xc/extras/Mesa/src/mmath.h b/xc/extras/Mesa/src/mmath.h index 1c3d17d59..20e13e0a5 100644 --- a/xc/extras/Mesa/src/mmath.h +++ b/xc/extras/Mesa/src/mmath.h @@ -204,7 +204,7 @@ do { \ #if defined(__i386__) || defined(__sparc__) || defined(__s390x__) || \ - defined(__powerpc__) || \ + defined(__powerpc__) || defined(__AMD64__) || \ ( defined(__alpha__) && ( defined(__IEEE_FLOAT) || !defined(VMS) ) ) #define USE_IEEE #endif diff --git a/xc/extras/Mesa/src/texstore.c b/xc/extras/Mesa/src/texstore.c index f443c2233..d1581474f 100644 --- a/xc/extras/Mesa/src/texstore.c +++ b/xc/extras/Mesa/src/texstore.c @@ -1,7 +1,7 @@ /* * Mesa 3-D graphics library - * Version: 5.0.1 + * Version: 5.0.2 * * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. * @@ -1096,7 +1096,7 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, texImage->Format, texImage->TexFormat, texImage->Data, width, height, depth, /* src size */ - xoffset, yoffset, xoffset, /* dest offsets */ + xoffset, yoffset, zoffset, /* dest offsets */ texImage->Width * texelBytes, /* dst row stride */ texImage->Width * texImage->Height * texelBytes, format, type, pixels, packing); diff --git a/xc/extras/Mesa/src/tnl/t_context.c b/xc/extras/Mesa/src/tnl/t_context.c index 906953712..b0a77474f 100644 --- a/xc/extras/Mesa/src/tnl/t_context.c +++ b/xc/extras/Mesa/src/tnl/t_context.c @@ -144,7 +144,8 @@ _tnl_DestroyContext( GLcontext *ctx ) _tnl_array_destroy( ctx ); _tnl_imm_destroy( ctx ); _tnl_destroy_pipeline( ctx ); - _tnl_free_immediate( ctx, tnl->freed_immediate ); + if (tnl->freed_immediate) + _tnl_free_immediate( ctx, tnl->freed_immediate ); FREE(tnl); ctx->swtnl_context = 0; diff --git a/xc/extras/Mesa/src/tnl/t_vb_texgen.c b/xc/extras/Mesa/src/tnl/t_vb_texgen.c index 79601a836..521d2f6e8 100644 --- a/xc/extras/Mesa/src/tnl/t_vb_texgen.c +++ b/xc/extras/Mesa/src/tnl/t_vb_texgen.c @@ -321,6 +321,7 @@ static void texgen_sphere_map( GLcontext *ctx, GLfloat (*f)[3] = store->tmp_f; GLfloat *m = store->tmp_m; + /* _mesa_debug(NULL, "%s normstride %d eyestride %d\n", */ /* __FUNCTION__, VB->NormalPtr->stride, */ /* VB->EyePtr->stride); */ @@ -358,22 +359,20 @@ static void texgen( GLcontext *ctx, struct vertex_buffer *VB = &tnl->vb; GLvector4f *in = VB->TexCoordPtr[unit]; GLvector4f *out = &store->texcoord[unit]; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; const GLvector4f *obj = VB->ObjPtr; const GLvector4f *eye = VB->EyePtr; const GLvector4f *normal = VB->NormalPtr; + const GLfloat *m = store->tmp_m; + const GLuint count = VB->Count; GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->data; - GLfloat *indata; - GLuint count = VB->Count; GLfloat (*f)[3] = store->tmp_f; - GLfloat *m = store->tmp_m; GLuint holes = 0; - if (texUnit->_GenFlags & TEXGEN_NEED_M) { - build_m_tab[in->size]( store->tmp_f, store->tmp_m, normal, eye ); + build_m_tab[eye->size]( store->tmp_f, store->tmp_m, normal, eye ); } else if (texUnit->_GenFlags & TEXGEN_NEED_F) { - build_f_tab[in->size]( (GLfloat *)store->tmp_f, 3, normal, eye ); + build_f_tab[eye->size]( (GLfloat *)store->tmp_f, 3, normal, eye ); } if (!in) { @@ -419,8 +418,8 @@ static void texgen( GLcontext *ctx, texUnit->EyePlaneS ); break; case GL_SPHERE_MAP: - for (indata=in->start,i=0 ; i<count ;i++, STRIDE_F(indata,in->stride)) - texcoord[i][0] = indata[0] * m[i] + 0.5F; + for (i = 0; i < count; i++) + texcoord[i][0] = f[i][0] * m[i] + 0.5F; break; case GL_REFLECTION_MAP_NV: for (i=0;i<count;i++) @@ -452,8 +451,8 @@ static void texgen( GLcontext *ctx, texUnit->EyePlaneT ); break; case GL_SPHERE_MAP: - for (indata=in->start,i=0; i<count ;i++,STRIDE_F(indata,in->stride)) - texcoord[i][1] = indata[1] * m[i] + 0.5F; + for (i = 0; i < count; i++) + texcoord[i][1] = f[i][1] * m[i] + 0.5F; break; case GL_REFLECTION_MAP_NV: for (i=0;i<count;i++) @@ -553,9 +552,9 @@ static GLboolean run_validate_texgen_stage( GLcontext *ctx, if (texUnit->TexGenEnabled) { GLuint sz; - if (texUnit->TexGenEnabled & R_BIT) + if (texUnit->TexGenEnabled & Q_BIT) sz = 4; - else if (texUnit->TexGenEnabled & Q_BIT) + else if (texUnit->TexGenEnabled & R_BIT) sz = 3; else if (texUnit->TexGenEnabled & T_BIT) sz = 2; @@ -564,8 +563,9 @@ static GLboolean run_validate_texgen_stage( GLcontext *ctx, store->TexgenSize[i] = sz; store->TexgenHoles[i] = (all_bits[sz] & ~texUnit->TexGenEnabled); - store->TexgenFunc[i] = texgen; + store->TexgenFunc[i] = texgen; /* general solution */ + /* look for special texgen cases */ if (texUnit->TexGenEnabled == (S_BIT|T_BIT|R_BIT)) { if (texUnit->_GenFlags == TEXGEN_REFLECTION_MAP_NV) { store->TexgenFunc[i] = texgen_reflection_map_nv; |