-/* $Id: ac_context.c,v 1.2 2001/02/04 00:47:28 keithw Exp $ */
+/* $Id: ac_context.c,v 1.3 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
ACcontext *ac = AC_CONTEXT(ctx);
struct gl_client_array *cl;
GLuint i;
-
+
cl = &ac->Fallback.Normal;
cl->Size = 3;
cl->Type = GL_FLOAT;
if (ac->Cache.FogCoord.Ptr) FREE( ac->Cache.FogCoord.Ptr );
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
- if (ac->Cache.TexCoord[i].Ptr)
+ if (ac->Cache.TexCoord[i].Ptr)
FREE( ac->Cache.TexCoord[i].Ptr );
}
-
-/* $Id: ac_context.h,v 1.2 2001/02/04 00:47:28 keithw Exp $ */
+/* $Id: ac_context.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
struct ac_array_flags IsCached;
GLuint start;
GLuint count;
-
+
/* Facility for importing element lists:
*/
GLuint *Elts;
-/* $Id: ac_import.c,v 1.8 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: ac_import.c,v 1.9 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
#include "math/m_translate.h"
#include "array_cache/ac_context.h"
-#include "math/m_translate.h"
+#include "math/m_translate.h"
#define STRIDE_ARRAY( array, offset ) \
do { \
else {
ac->Raw.TexCoord[unit] = ac->Fallback.TexCoord[unit];
- if (ctx->Current.Texcoord[unit][3] != 1.0)
+ if (ctx->Current.Texcoord[unit][3] != 1.0)
ac->Raw.TexCoord[unit].Size = 4;
else if (ctx->Current.Texcoord[unit][2] != 0.0)
ac->Raw.TexCoord[unit].Size = 3;
ac->Raw.Color = ctx->Array.Color;
STRIDE_ARRAY(ac->Raw.Color, ac->start);
}
- else
+ else
ac->Raw.Color = ac->Fallback.Color;
ac->IsCached.Color = GL_FALSE;
ac->Raw.SecondaryColor = ctx->Array.SecondaryColor;
STRIDE_ARRAY(ac->Raw.SecondaryColor, ac->start);
}
- else
+ else
ac->Raw.SecondaryColor = ac->Fallback.SecondaryColor;
ac->IsCached.SecondaryColor = GL_FALSE;
ac->Raw.Index = ctx->Array.Index;
STRIDE_ARRAY(ac->Raw.Index, ac->start);
}
- else
+ else
ac->Raw.Index = ac->Fallback.Index;
ac->IsCached.Index = GL_FALSE;
ac->Raw.FogCoord = ctx->Array.FogCoord;
STRIDE_ARRAY(ac->Raw.FogCoord, ac->start);
}
- else
+ else
ac->Raw.FogCoord = ac->Fallback.FogCoord;
ac->IsCached.FogCoord = GL_FALSE;
ac->Raw.EdgeFlag = ctx->Array.EdgeFlag;
STRIDE_ARRAY(ac->Raw.EdgeFlag, ac->start);
}
- else
+ else
ac->Raw.EdgeFlag = ac->Fallback.EdgeFlag;
ac->IsCached.EdgeFlag = GL_FALSE;
ASSERT(type == GL_FLOAT);
ASSERT(stride == 4*sizeof(GLfloat) || stride == 0);
ASSERT(ac->count - ac->start < ctx->Const.MaxArrayLockSize);
-
+
_math_trans_4f( (GLfloat (*)[4]) to->Ptr,
from->Ptr,
from->StrideB,
from->Type,
from->Size,
- ac->start,
+ ac->start,
ac->count);
to->Size = from->Size;
from->StrideB,
from->Type,
from->Size,
- 0,
+ 0,
ac->count - ac->start);
to->Size = from->Size;
from->Ptr,
from->StrideB,
from->Type,
- 0,
+ 0,
ac->count - ac->start);
to->StrideB = 3 * sizeof(GLfloat);
from->StrideB,
from->Type,
from->Size,
- 0,
+ 0,
ac->count - ac->start);
to->Size = from->Size;
from->Ptr,
from->StrideB,
from->Type,
- 0,
+ 0,
ac->count - ac->start);
to->StrideB = sizeof(GLuint);
from->StrideB,
from->Type,
from->Size,
- 0,
+ 0,
ac->count - ac->start);
to->StrideB = 4 * sizeof(GLchan);
from->Ptr,
from->StrideB,
from->Type,
- 0,
+ 0,
ac->count - ac->start);
-
+
to->StrideB = sizeof(GLfloat);
to->Type = GL_FLOAT;
ac->IsCached.FogCoord = GL_TRUE;
from->Ptr,
from->StrideB,
from->Type,
- 0,
+ 0,
ac->count - ac->start);
-
+
to->StrideB = sizeof(GLfloat);
to->Type = GL_FLOAT;
ac->IsCached.EdgeFlag = GL_TRUE;
/* Externals to request arrays with specific properties:
*/
-struct gl_client_array *_ac_import_texcoord( GLcontext *ctx,
+struct gl_client_array *_ac_import_texcoord( GLcontext *ctx,
GLuint unit,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLuint reqsize,
GLboolean reqwriteable,
GLboolean *writeable )
*/
if (ac->Raw.TexCoord[unit].Type != type ||
(reqstride != 0 && ac->Raw.TexCoord[unit].StrideB != (GLint) reqstride) ||
- reqwriteable)
+ reqwriteable)
{
if (!ac->IsCached.TexCoord[unit])
import_texcoord(ctx, unit, type, reqstride );
}
}
-struct gl_client_array *_ac_import_vertex( GLcontext *ctx,
+struct gl_client_array *_ac_import_vertex( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLuint reqsize,
GLboolean reqwriteable,
GLboolean *writeable )
*/
if (ac->Raw.Vertex.Type != type ||
(reqstride != 0 && ac->Raw.Vertex.StrideB != (GLint) reqstride) ||
- reqwriteable)
+ reqwriteable)
{
if (!ac->IsCached.Vertex)
import_vertex(ctx, type, reqstride );
}
}
-struct gl_client_array *_ac_import_normal( GLcontext *ctx,
+struct gl_client_array *_ac_import_normal( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLboolean reqwriteable,
GLboolean *writeable )
{
/* Can we keep the existing version?
*/
- if (ac->NewArrayState & _NEW_ARRAY_NORMAL)
+ if (ac->NewArrayState & _NEW_ARRAY_NORMAL)
reset_normal( ctx );
/* Do we need to pull in a copy of the client data:
*/
if (ac->Raw.Normal.Type != type ||
(reqstride != 0 && ac->Raw.Normal.StrideB != (GLint) reqstride) ||
- reqwriteable)
+ reqwriteable)
{
if (!ac->IsCached.Normal)
import_normal(ctx, type, reqstride );
}
}
-struct gl_client_array *_ac_import_color( GLcontext *ctx,
+struct gl_client_array *_ac_import_color( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLuint reqsize,
GLboolean reqwriteable,
GLboolean *writeable )
/* Can we keep the existing version?
*/
- if (ac->NewArrayState & _NEW_ARRAY_COLOR)
+ if (ac->NewArrayState & _NEW_ARRAY_COLOR)
reset_color( ctx );
/* Is the request impossible?
*/
if (ac->Raw.Color.Type != type ||
(reqstride != 0 && ac->Raw.Color.StrideB != (GLint) reqstride) ||
- reqwriteable)
+ reqwriteable)
{
if (!ac->IsCached.Color)
import_color(ctx, type, reqstride );
}
}
-struct gl_client_array *_ac_import_index( GLcontext *ctx,
+struct gl_client_array *_ac_import_index( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLboolean reqwriteable,
GLboolean *writeable )
{
/* Can we keep the existing version?
*/
- if (ac->NewArrayState & _NEW_ARRAY_INDEX)
+ if (ac->NewArrayState & _NEW_ARRAY_INDEX)
reset_index( ctx );
*/
if (ac->Raw.Index.Type != type ||
(reqstride != 0 && ac->Raw.Index.StrideB != (GLint) reqstride) ||
- reqwriteable)
+ reqwriteable)
{
if (!ac->IsCached.Index)
import_index(ctx, type, reqstride );
}
}
-struct gl_client_array *_ac_import_secondarycolor( GLcontext *ctx,
+struct gl_client_array *_ac_import_secondarycolor( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLuint reqsize,
GLboolean reqwriteable,
GLboolean *writeable )
/* Can we keep the existing version?
*/
- if (ac->NewArrayState & _NEW_ARRAY_SECONDARYCOLOR)
+ if (ac->NewArrayState & _NEW_ARRAY_SECONDARYCOLOR)
reset_secondarycolor( ctx );
/* Is the request impossible?
*/
if (ac->Raw.SecondaryColor.Type != type ||
(reqstride != 0 && ac->Raw.SecondaryColor.StrideB != (GLint) reqstride) ||
- reqwriteable)
+ reqwriteable)
{
if (!ac->IsCached.SecondaryColor)
import_secondarycolor(ctx, type, reqstride );
}
}
-struct gl_client_array *_ac_import_fogcoord( GLcontext *ctx,
+struct gl_client_array *_ac_import_fogcoord( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLboolean reqwriteable,
GLboolean *writeable )
{
/* Can we keep the existing version?
*/
- if (ac->NewArrayState & _NEW_ARRAY_FOGCOORD)
+ if (ac->NewArrayState & _NEW_ARRAY_FOGCOORD)
reset_fogcoord( ctx );
/* Do we need to pull in a copy of the client data:
*/
if (ac->Raw.FogCoord.Type != type ||
(reqstride != 0 && ac->Raw.FogCoord.StrideB != (GLint) reqstride) ||
- reqwriteable)
+ reqwriteable)
{
if (!ac->IsCached.FogCoord)
import_fogcoord(ctx, type, reqstride );
-struct gl_client_array *_ac_import_edgeflag( GLcontext *ctx,
+struct gl_client_array *_ac_import_edgeflag( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLboolean reqwriteable,
GLboolean *writeable )
{
/* Can we keep the existing version?
*/
- if (ac->NewArrayState & _NEW_ARRAY_EDGEFLAG)
+ if (ac->NewArrayState & _NEW_ARRAY_EDGEFLAG)
reset_edgeflag( ctx );
/* Do we need to pull in a copy of the client data:
*/
if (ac->Raw.EdgeFlag.Type != type ||
(reqstride != 0 && ac->Raw.EdgeFlag.StrideB != (GLint) reqstride) ||
- reqwriteable)
+ reqwriteable)
{
if (!ac->IsCached.EdgeFlag)
import_edgeflag(ctx, type, reqstride );
/* Clients must call this function to validate state and set bounds
- * before importing any data:
+ * before importing any data:
*/
void _ac_import_range( GLcontext *ctx, GLuint start, GLuint count )
{
* the whole locked range always be dealt with, otherwise hard to
* maintain cached data in the face of clipping.
*/
- ac->NewArrayState |= ~ctx->Array._Enabled;
+ ac->NewArrayState |= ~ctx->Array._Enabled;
ac->start = ctx->Array.LockFirst;
ac->count = ctx->Array.LockCount;
ASSERT(ac->start == start); /* hmm? */
CONST void *indices )
{
ACcontext *ac = AC_CONTEXT(ctx);
-
+
if (old_type == new_type)
return indices;
if (ac->elt_size < count * sizeof(GLuint)) {
if (ac->Elts) FREE(ac->Elts);
- while (ac->elt_size < count * sizeof(GLuint))
+ while (ac->elt_size < count * sizeof(GLuint))
ac->elt_size *= 2;
ac->Elts = (GLuint *) MALLOC(ac->elt_size);
}
case GL_UNSIGNED_INT: {
GLuint *out = (GLuint *)ac->Elts;
GLuint i;
-
+
switch (old_type) {
case GL_UNSIGNED_BYTE: {
CONST GLubyte *in = (CONST GLubyte *)indices;
return 0;
}
-
+/* $Id: acache.h,v 1.2 2001/03/12 00:48:41 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
_ac_InvalidateState( GLcontext *ctx, GLuint new_state );
extern struct gl_client_array *
-_ac_import_texcoord( GLcontext *ctx,
+_ac_import_texcoord( GLcontext *ctx,
GLuint unit,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLuint reqsize,
GLboolean reqwritable,
GLboolean *writable );
extern struct gl_client_array *
-_ac_import_vertex( GLcontext *ctx,
+_ac_import_vertex( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLuint reqsize,
GLboolean reqwritable,
GLboolean *writable );
extern struct gl_client_array *
-_ac_import_normal( GLcontext *ctx,
+_ac_import_normal( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLboolean reqwritable,
GLboolean *writable );
extern struct gl_client_array *
-_ac_import_color( GLcontext *ctx,
+_ac_import_color( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLuint reqsize,
GLboolean reqwritable,
GLboolean *writable );
extern struct gl_client_array *
-_ac_import_index( GLcontext *ctx,
+_ac_import_index( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLboolean reqwritable,
GLboolean *writable );
extern struct gl_client_array *
-_ac_import_secondarycolor( GLcontext *ctx,
+_ac_import_secondarycolor( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLuint reqsize,
GLboolean reqwritable,
GLboolean *writable );
extern struct gl_client_array *
-_ac_import_fogcoord( GLcontext *ctx,
+_ac_import_fogcoord( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLboolean reqwritable,
GLboolean *writable );
extern struct gl_client_array *
-_ac_import_edgeflag( GLcontext *ctx,
+_ac_import_edgeflag( GLcontext *ctx,
GLenum type,
- GLuint reqstride,
+ GLuint reqstride,
GLboolean reqwritable,
GLboolean *writable );
/* Clients must call this function to validate state and set bounds
- * before importing any data:
+ * before importing any data:
*/
-extern void
+extern void
_ac_import_range( GLcontext *ctx, GLuint start, GLuint count );
+/* $Id: t_dd.c,v 1.2 2001/03/12 00:48:44 gareth Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
+ */
static void copy_pv_rgba4_spec5( GLcontext *ctx, GLuint edst, GLuint esrc )
{
i810Vertex *src = (i810Vertex *)(i810verts + (esrc << shift));
dst->ui[3] = src->ui[3];
}
-
+/* $Id: t_dd_dmatmp.h,v 1.6 2001/03/12 00:48:44 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
- * Keith Whitwell <keithw@valinux.com>
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
*/
/* Template for render stages which build and emit vertices directly
* to fixed-size dma buffers. Useful for rendering strips and other
* native primitives where clipping and per-vertex tweaks such as
- * those in t_dd_tritmp.h are not required.
+ * those in t_dd_tritmp.h are not required.
*
* Produces code for both inline triangles and indexed triangles.
* Where various primitive types are unaccelerated by hardware, the
* code attempts to fallback to other primitive types (quadstrips to
* tristrips, lineloops to linestrips), or to indexed vertices.
* Ultimately, a FALLBACK() macro is invoked if there is no way to
- * render the primitive natively.
+ * render the primitive natively.
*/
#if !defined(HAVE_TRIANGLES)
#error "must have at least triangles to use render template"
#endif
-#if !HAVE_ELTS
+#if !HAVE_ELTS
#define ELTS_VARS
#define ALLOC_ELTS( nr )
#define EMIT_ELT( offset, elt )
#define INCR_ELTS( nr )
-#define ELT_INIT(prim)
+#define ELT_INIT(prim)
#define GET_CURRENT_VB_MAX_ELTS() 0
#define GET_SUBSEQUENT_VB_MAX_ELTS() 0
#define ALLOC_ELTS_NEW_PRIMITIVE(nr)
-#define RELEASE_ELT_VERTS()
-#define EMIT_INDEXED_VERTS( ctx, start, count )
+#define RELEASE_ELT_VERTS()
+#define EMIT_INDEXED_VERTS( ctx, start, count )
#endif
#ifndef EMIT_TWO_ELTS
EMIT_ELT( offset+1, elt1 ); \
} while (0)
#endif
-
+
/**********************************************************************/
/* Render whole begin/end objects */
/**********************************************************************/
-static GLboolean TAG(emit_elt_verts)( GLcontext *ctx,
+static GLboolean TAG(emit_elt_verts)( GLcontext *ctx,
GLuint start, GLuint count )
{
if (HAVE_ELTS) {
LOCAL_VARS;
GLuint nr = count - start;
- if ( nr >= GET_SUBSEQUENT_VB_MAX_VERTS() ) /* assumes same packing for
+ if ( nr >= GET_SUBSEQUENT_VB_MAX_VERTS() ) /* assumes same packing for
* indexed and regualar verts
*/
return GL_FALSE;
ALLOC_ELTS( nr );
- for ( i = 0 ; i < nr ; i+=2, elts += 2 ) {
- EMIT_TWO_ELTS( 0, elts[0], elts[1] );
+ for ( i = 0 ; i < nr ; i+=2, elts += 2 ) {
+ EMIT_TWO_ELTS( 0, elts[0], elts[1] );
INCR_ELTS( 2 );
}
}
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
int currentsz = GET_CURRENT_VB_MAX_VERTS();
GLuint j, nr;
-
+
INIT( GL_POINTS );
-
+
if (currentsz < 8)
currentsz = dmasz;
-
+
for (j = start; j < count; j += nr ) {
nr = MIN2( currentsz, count - j );
EMIT_VERTS( ctx, j, nr );
GLuint j, nr;
INIT( GL_LINES );
-
+
/* Emit whole number of lines in total and in each buffer:
*/
count -= (count-start) & 1;
NEW_PRIMITIVE();
INIT( GL_LINE_STRIP );
- if (flags & PRIM_BEGIN)
+ if (flags & PRIM_BEGIN)
j = start;
else
j = start + 1;
currentsz--;
dmasz--;
- if (currentsz < 8)
+ if (currentsz < 8)
currentsz = dmasz;
for ( ; j < count - 1; j += nr - 1 ) {
EMIT_VERTS( ctx, j, nr );
currentsz = dmasz;
}
-
- if (flags & PRIM_END)
+
+ if (flags & PRIM_END)
EMIT_VERTS( ctx, start, 1 );
} else {
GLuint j, nr;
INIT(GL_TRIANGLES);
-
+
/* Emit whole number of tris in total. dmasz is already a multiple
* of 3.
*/
GLuint j, nr;
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
int currentsz;
-
+
INIT(GL_TRIANGLE_STRIP);
NEW_PRIMITIVE();
-
+
currentsz = GET_CURRENT_VB_MAX_VERTS();
-
+
if (currentsz < 8) {
FIRE_VERTICES();
currentsz = dmasz;
*/
dmasz -= (dmasz & 1);
currentsz -= (currentsz & 1);
-
+
for (j = start ; j < count - 2; j += nr - 2 ) {
nr = MIN2( currentsz, count - j );
EMIT_VERTS( ctx, j, nr );
GLuint j, nr;
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
int currentsz = GET_CURRENT_VB_MAX_VERTS();
-
+
NEW_PRIMITIVE();
INIT(GL_TRIANGLE_FAN);
EMIT_VERTS( ctx, j, nr - 1 );
currentsz = dmasz;
}
- }
+ }
else {
/* Could write code to emit these as indexed vertices (for the
* g400, for instance).
FIRE_VERTICES();
currentsz = dmasz;
}
-
+
for (j = start + 1 ; j < count - 1 ; j += nr - 1 ) {
nr = MIN2( currentsz, count - j + 1 );
EMIT_VERTS( ctx, start, 1 );
EMIT_VERTS( ctx, j, nr - 1 );
currentsz = dmasz;
}
- }
+ }
else if (HAVE_TRI_FANS && !(ctx->_TriangleCaps & DD_FLATSHADE)) {
TAG(render_tri_fan_verts)( ctx, start, count, flags );
} else {
/* TODO.
*/
} else if (HAVE_TRI_STRIPS && ctx->_TriangleCaps & DD_FLATSHADE) {
- if (TAG(emit_elt_verts)( ctx, start, count )) {
+ if (TAG(emit_elt_verts)( ctx, start, count )) {
LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
int currentsz;
dmasz -= dmasz & 1;
count -= (count-start) & 1;
currentsz -= currentsz & 1;
-
+
if (currentsz < 12)
currentsz = dmasz;
NEW_PRIMITIVE();
ALLOC_ELTS_NEW_PRIMITIVE( quads*6 );
-
+
for ( i = 0 ; i < quads*2 ; i+=2 ) {
EMIT_TWO_ELTS( 0, (i+0), (i+1) );
EMIT_TWO_ELTS( 2, (i+2), (i+1) );
EMIT_TWO_ELTS( 4, (i+3), (i+2) );
INCR_ELTS( 6 );
}
-
+
NEW_PRIMITIVE();
}
currentsz = dmasz;
}
RELEASE_ELT_VERTS();
- }
+ }
else {
/* Vertices won't fit in a single buffer or elts not available,
* VERT_FALLBACK.
*/
VERT_FALLBACK( ctx, start, count, flags );
}
- }
+ }
else if (HAVE_TRI_STRIPS) {
LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
dmasz -= dmasz & 1;
currentsz -= currentsz & 1;
count -= (count-start) & 1;
-
+
if (currentsz < 8) {
FIRE_VERTICES();
currentsz = dmasz;
GLuint flags )
{
if (HAVE_QUADS && 0) {
- } else if (TAG(emit_elt_verts)( ctx, start, count )) {
+ } else if (TAG(emit_elt_verts)( ctx, start, count )) {
/* Hardware doesn't have a quad primitive type -- try to
* simulate it using indexed vertices and the triangle
- * primitive:
+ * primitive:
*/
LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
EMIT_TWO_ELTS( 4, (i+2), (i+3) );
INCR_ELTS( 6 );
}
-
+
NEW_PRIMITIVE();
}
currentsz = dmasz;
}
-
+
RELEASE_ELT_VERTS();
- }
+ }
else {
/* Vertices won't fit in a single buffer, fallback.
*/
-static render_func TAG(render_tab_verts)[GL_POLYGON+2] =
+static render_func TAG(render_tab_verts)[GL_POLYGON+2] =
{
TAG(render_points_verts),
TAG(render_lines_verts),
* Render elts using hardware indexed verts *
****************************************************************************/
-#if (HAVE_ELTS)
+#if (HAVE_ELTS)
static void TAG(render_points_elts)( GLcontext *ctx,
GLuint start,
GLuint count,
int currentsz;
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
GLuint j, nr;
-
+
ELT_INIT( GL_POINTS );
-
+
currentsz = GET_CURRENT_VB_MAX_ELTS();
if (currentsz < 8)
currentsz = dmasz;
int currentsz;
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
GLuint j, nr;
-
+
NEW_PRIMITIVE();
ELT_INIT( GL_LINE_STRIP );
-
- if (flags & PRIM_BEGIN)
+
+ if (flags & PRIM_BEGIN)
j = start;
else
j = start + 1;
-
+
currentsz = GET_CURRENT_VB_MAX_ELTS();
if (currentsz < 8) {
FIRE_VERTICES();
currentsz = dmasz;
}
-
+
/* Ensure last vertex doesn't wrap:
*/
currentsz--;
dmasz--;
-
+
for ( ; j < count - 1; j += nr - 1 ) {
nr = MIN2( currentsz, count - j );
/* NEW_PRIMITIVE(); */
TAG(emit_elts)( ctx, elts+j, nr );
currentsz = dmasz;
}
-
- if (flags & PRIM_END)
+
+ if (flags & PRIM_END)
TAG(emit_elts)( ctx, elts+start, 1 );
NEW_PRIMITIVE();
NEW_PRIMITIVE();
ELT_INIT( GL_TRIANGLES );
-
+
currentsz = GET_CURRENT_VB_MAX_ELTS();
/* Emit whole number of tris in total. dmasz is already a multiple
NEW_PRIMITIVE();
ELT_INIT( GL_TRIANGLE_STRIP );
-
+
currentsz = GET_CURRENT_VB_MAX_ELTS();
if (currentsz < 8) {
FIRE_VERTICES();
currentsz = dmasz;
}
-
+
if (flags & PRIM_PARITY) {
TAG(emit_elts)( ctx, elts+start, 1 );
}
-
+
/* Keep the same winding over multiple buffers:
*/
dmasz -= (dmasz & 1);
GLuint flags )
{
if (HAVE_QUAD_STRIPS && 0) {
- }
+ }
else if (HAVE_TRI_STRIPS) {
LOCAL_VARS;
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
dmasz -= dmasz & 1;
count -= (count-start) & 1;
currentsz -= currentsz & 1;
-
+
if (currentsz < 12)
currentsz = dmasz;
- if (ctx->_TriangleCaps & DD_FLATSHADE) {
+ if (ctx->_TriangleCaps & DD_FLATSHADE) {
ELT_INIT( GL_TRIANGLES );
currentsz = currentsz/6*2;
for (j = start; j < count - 3; j += nr - 2 ) {
nr = MIN2( currentsz, count - j );
- if (nr >= 4)
+ if (nr >= 4)
{
GLint i;
GLint quads = (nr/2)-1;
NEW_PRIMITIVE();
ALLOC_ELTS_NEW_PRIMITIVE( quads*6 );
-
+
for ( i = 0 ; i < quads ; i++, elts += 2 ) {
EMIT_TWO_ELTS( 0, elts[0], elts[1] );
EMIT_TWO_ELTS( 2, elts[2], elts[1] );
EMIT_TWO_ELTS( 4, elts[3], elts[2] );
INCR_ELTS( 6 );
}
-
+
NEW_PRIMITIVE();
}
currentsz = dmasz;
}
- }
+ }
else {
ELT_INIT( GL_TRIANGLE_STRIP );
for (j = start; j < count - 3; j += nr - 2 ) {
nr = MIN2( currentsz, count - j );
- if (nr >= 4)
+ if (nr >= 4)
{
GLint quads = nr/4;
GLint i;
-static render_func TAG(render_tab_elts)[GL_POLYGON+2] =
+static render_func TAG(render_tab_elts)[GL_POLYGON+2] =
{
TAG(render_points_elts),
TAG(render_lines_elts),
TAG(render_noop),
};
#endif
-
-/* $Id: t_dd_rendertmp.h,v 1.1 2001/02/16 18:14:42 keithw Exp $ */
+/* $Id: t_dd_rendertmp.h,v 1.2 2001/03/12 00:48:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
#endif
#ifndef INIT
-#define INIT(x)
+#define INIT(x)
#endif
#ifndef NEED_EDGEFLAG_SETUP
#define NEED_EDGEFLAG_SETUP 0
#define EDGEFLAG_GET(a) 0
-#define EDGEFLAG_SET(a,b) (void)b
+#define EDGEFLAG_SET(a,b) (void)b
#endif
#ifndef RESET_STIPPLE
RESET_OCCLUSION;
INIT(GL_LINE_STRIP);
- for (j=start+1; j<count; j++ )
+ for (j=start+1; j<count; j++ )
RENDER_LINE( ELT(j-1), ELT(j) );
if (TEST_PRIM_END(flags))
GLuint count,
GLuint flags )
{
- GLuint i;
+ GLuint i;
LOCAL_VARS;
(void) flags;
GLuint j;
GLuint parity = 0;
LOCAL_VARS;
-
+
if (TEST_PRIM_PARITY(flags))
parity = 1;
-
+
INIT(GL_TRIANGLE_STRIP);
if (NEED_EDGEFLAG_SETUP) {
for (j=start+2;j<count;j++,parity^=1) {
/* If the primitive does not begin here, the first edge
* is non-boundary.
*/
- if (!TEST_PRIM_BEGIN(flags))
+ if (!TEST_PRIM_BEGIN(flags))
EDGEFLAG_SET( ELT(start), GL_FALSE );
/* If the primitive does not end here, the final edge is
* non-boundary.
*/
- if (!TEST_PRIM_END(flags))
+ if (!TEST_PRIM_END(flags))
EDGEFLAG_SET( ELT(count-1), GL_FALSE );
/* Draw the first triangles (possibly zero)
RENDER_TRI( ELT(j-1), ELT(j), ELT(start) );
EDGEFLAG_SET( ELT(j), ef );
j++;
-
+
/* Don't render the first edge again:
*/
EDGEFLAG_SET( ELT(start), GL_FALSE );
*/
EDGEFLAG_SET( ELT(count-1), efcount );
EDGEFLAG_SET( ELT(start), efstart );
-
+
if (TEST_PRIM_END(flags)) {
RESET_STIPPLE;
}
}
}
POSTFIX;
-}
+}
static void TAG(render_quad_strip)( GLcontext *ctx,
GLuint start,
RENDER_TAB_QUALIFIER void (*TAG(render_tab)[GL_POLYGON+2])(GLcontext *,
GLuint,
GLuint,
- GLuint) =
+ GLuint) =
{
TAG(render_points),
TAG(render_lines),
#undef PRESERVE_VB_DEFS
#undef PRESERVE_TAG
-
+/* $Id: t_dd_tritmp.h,v 1.6 2001/03/12 00:48:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001
+Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
- * Keith Whitwell <keithw@valinux.com>
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
*/
/* Template for building functions to plug into the driver interface
* of t_vb_render.c:
- * ctx->Driver.QuadFunc
- * ctx->Driver.TriangleFunc
- * ctx->Driver.LineFunc
- * ctx->Driver.PointsFunc
+ * ctx->Driver.QuadFunc
+ * ctx->Driver.TriangleFunc
+ * ctx->Driver.LineFunc
+ * ctx->Driver.PointsFunc
*
- * DO_TWOSIDE: Plug back-color values from the VB into backfacing triangles,
+ * DO_TWOSIDE: Plug back-color values from the VB into backfacing triangles,
* and restore vertices afterwards.
* DO_OFFSET: Calculate offset for triangles and adjust vertices. Restore
* vertices after rendering.
#if HAVE_RGBA
#define VERT_SET_IND( v, c ) (void) c
#define VERT_COPY_IND( v0, v1 )
-#define VERT_SAVE_IND( idx )
-#define VERT_RESTORE_IND( idx )
-#if HAVE_BACK_COLORS
-#define VERT_SET_RGBA( v, c )
-#endif
+#define VERT_SAVE_IND( idx )
+#define VERT_RESTORE_IND( idx )
+#if HAVE_BACK_COLORS
+#define VERT_SET_RGBA( v, c )
+#endif
#else
#define VERT_SET_RGBA( v, c ) (void) c
#define VERT_COPY_RGBA( v0, v1 )
-#define VERT_SAVE_RGBA( idx )
-#define VERT_RESTORE_RGBA( idx )
-#if HAVE_BACK_COLORS
-#define VERT_SET_IND( v, c )
-#endif
+#define VERT_SAVE_RGBA( idx )
+#define VERT_RESTORE_RGBA( idx )
+#if HAVE_BACK_COLORS
+#define VERT_SET_IND( v, c )
+#endif
#endif
#if !HAVE_SPEC
#define VERT_SET_SPEC( v, c ) (void) c
#define VERT_COPY_SPEC( v0, v1 )
-#define VERT_SAVE_SPEC( idx )
-#define VERT_RESTORE_SPEC( idx )
+#define VERT_SAVE_SPEC( idx )
+#define VERT_RESTORE_SPEC( idx )
#if HAVE_BACK_COLORS
#define VERT_COPY_SPEC1( v )
#endif
#else
#if HAVE_BACK_COLORS
-#define VERT_SET_SPEC( v, c )
+#define VERT_SET_SPEC( v, c )
#endif
#endif
#if !HAVE_BACK_COLORS
#define VERT_COPY_SPEC1( v )
#define VERT_COPY_IND1( v )
-#define VERT_COPY_RGBA1( v )
+#define VERT_COPY_RGBA1( v )
#endif
#ifndef INSANE_VERTICES
if (DO_UNFILLED) {
if (facing) {
mode = ctx->Polygon.BackMode;
- if (ctx->Polygon.CullFlag &&
+ if (ctx->Polygon.CullFlag &&
ctx->Polygon.CullFaceMode != GL_FRONT) {
return;
}
VERT_SAVE_SPEC( 2 );
VERT_COPY_SPEC1( v[2] );
}
- }
+ }
else {
GLchan (*vbcolor)[4] = VB->ColorPtr[1]->data;
ASSERT(VB->ColorPtr[1]->stride == 4*sizeof(GLchan));
VERT_SET_RGBA( v[1], vbcolor[e1] );
}
VERT_SET_RGBA( v[2], vbcolor[e2] );
-
+
if (HAVE_SPEC && VB->SecondaryColorPtr[1]) {
GLchan (*vbspec)[4] = VB->SecondaryColorPtr[1]->data;
-
+
if (!DO_FLAT) {
VERT_SET_SPEC( v[0], vbspec[e0] );
VERT_SET_SPEC( v[1], vbspec[e1] );
}
VERT_SET_SPEC( v[2], vbspec[e2] );
}
- }
+ }
}
else {
GLuint *vbindex = VB->IndexPtr[1]->data;
VERT_COPY_SPEC( v[0], v[2] );
VERT_COPY_SPEC( v[1], v[2] );
}
- }
+ }
else {
VERT_SAVE_IND( 0 );
VERT_SAVE_IND( 1 );
}
if (DO_UNFILLED)
RASTERIZE( GL_TRIANGLES );
- TRI( v[0], v[1], v[2] );
+ TRI( v[0], v[1], v[2] );
}
if (DO_OFFSET)
VERT_RESTORE_SPEC( 1 );
VERT_RESTORE_SPEC( 2 );
}
- }
+ }
else {
GLchan (*vbcolor)[4] = VB->ColorPtr[0]->data;
ASSERT(VB->ColorPtr[0]->stride == 4*sizeof(GLchan));
(void) vbcolor;
-
+
if (!DO_FLAT) {
VERT_SET_RGBA( v[0], vbcolor[e0] );
VERT_SET_RGBA( v[1], vbcolor[e1] );
}
VERT_SET_RGBA( v[2], vbcolor[e2] );
-
+
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
GLchan (*vbspec)[4] = VB->SecondaryColorPtr[0]->data;
ASSERT(VB->SecondaryColorPtr[0]->stride == 4*sizeof(GLchan));
-
+
if (!DO_FLAT) {
VERT_SET_SPEC( v[0], vbspec[e0] );
VERT_SET_SPEC( v[1], vbspec[e1] );
VERT_SET_SPEC( v[2], vbspec[e2] );
}
}
- }
+ }
else {
GLuint *vbindex = VB->IndexPtr[0]->data;
if (!DO_FLAT) {
VERT_RESTORE_SPEC( 0 );
VERT_RESTORE_SPEC( 1 );
}
- }
+ }
else {
VERT_RESTORE_IND( 0 );
VERT_RESTORE_IND( 1 );
if (DO_UNFILLED) {
if (facing) {
mode = ctx->Polygon.BackMode;
- if (ctx->Polygon.CullFlag &&
+ if (ctx->Polygon.CullFlag &&
ctx->Polygon.CullFaceMode != GL_FRONT) {
return;
}
if (HAVE_RGBA) {
GLchan (*vbcolor)[4] = VB->ColorPtr[1]->data;
(void)vbcolor;
-
+
if (!DO_FLAT) {
VERT_SET_RGBA( v[0], vbcolor[e0] );
VERT_SET_RGBA( v[1], vbcolor[e1] );
VERT_COPY_SPEC( v[1], v[3] );
VERT_COPY_SPEC( v[2], v[3] );
}
- }
+ }
else {
VERT_SAVE_IND( 0 );
VERT_SAVE_IND( 1 );
VERT_Z_ADD(v[3], offset);
}
RASTERIZE( GL_TRIANGLES );
- QUAD( (v[0]), (v[1]), (v[2]), (v[3]) );
+ QUAD( (v[0]), (v[1]), (v[2]), (v[3]) );
}
if (DO_OFFSET)
VERT_SET_Z(v[1], z[1]);
VERT_SET_Z(v[2], z[2]);
VERT_SET_Z(v[3], z[3]);
- }
+ }
if (DO_TWOSIDE && facing == 1)
{
GLchan (*vbcolor)[4] = VB->ColorPtr[0]->data;
ASSERT(VB->ColorPtr[0]->stride == 4*sizeof(GLchan));
(void) vbcolor;
-
+
if (!DO_FLAT) {
VERT_SET_RGBA( v[0], vbcolor[e0] );
VERT_SET_RGBA( v[1], vbcolor[e1] );
VERT_SET_RGBA( v[2], vbcolor[e2] );
}
VERT_SET_RGBA( v[3], vbcolor[e3] );
-
+
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
GLchan (*vbspec)[4] = VB->SecondaryColorPtr[0]->data;
ASSERT(VB->SecondaryColorPtr[0]->stride == 4*sizeof(GLchan));
-
+
if (!DO_FLAT) {
VERT_SET_SPEC( v[0], vbspec[e0] );
VERT_SET_SPEC( v[1], vbspec[e1] );
}
VERT_SET_SPEC( v[3], vbspec[e3] );
}
- }
+ }
else {
GLuint *vbindex = VB->IndexPtr[0]->data;
if (!DO_FLAT) {
VERT_RESTORE_SPEC( 1 );
VERT_RESTORE_SPEC( 2 );
}
- }
+ }
else {
VERT_RESTORE_IND( 0 );
VERT_RESTORE_IND( 1 );
}
}
}
-#else
+#else
static void TAG(quad)( GLcontext *ctx, GLuint e0,
GLuint e1, GLuint e2, GLuint e3 )
{
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLubyte ef1 = VB->EdgeFlag[e1];
GLubyte ef3 = VB->EdgeFlag[e3];
- VB->EdgeFlag[e1] = 0;
+ VB->EdgeFlag[e1] = 0;
TAG(triangle)( ctx, e0, e1, e3 );
VB->EdgeFlag[e1] = ef1;
- VB->EdgeFlag[e3] = 0;
- TAG(triangle)( ctx, e1, e2, e3 );
- VB->EdgeFlag[e3] = ef3;
+ VB->EdgeFlag[e3] = 0;
+ TAG(triangle)( ctx, e1, e2, e3 );
+ VB->EdgeFlag[e3] = ef3;
} else {
TAG(triangle)( ctx, e0, e1, e3 );
TAG(triangle)( ctx, e1, e2, e3 );
VERT_SAVE_SPEC( 0 );
VERT_COPY_SPEC( v[0], v[1] );
}
- }
+ }
else {
VERT_SAVE_IND( 0 );
VERT_COPY_IND( v[0], v[1] );
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
VERT_RESTORE_SPEC( 0 );
}
- }
+ }
else {
VERT_RESTORE_IND( 0 );
}
#undef VERT_COPY_IND
#undef VERT_SAVE_IND
#undef VERT_RESTORE_IND
-#if HAVE_BACK_COLORS
+#if HAVE_BACK_COLORS
#undef VERT_SET_RGBA
-#endif
+#endif
#else
#undef VERT_SET_RGBA
#undef VERT_COPY_RGBA
#undef VERT_SAVE_RGBA
#undef VERT_RESTORE_RGBA
-#if HAVE_BACK_COLORS
+#if HAVE_BACK_COLORS
#undef VERT_SET_IND
-#endif
+#endif
#endif
#if !HAVE_SPEC
#undef VERT_SET_Z
#undef VERT_Z_ADD
#endif
-
+/* $Id: t_dd_unfilled.h,v 1.3 2001/03/12 00:48:44 gareth Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
+ */
+
#if HAVE_RGBA
-#define VERT_SET_IND( v, c )
+#define VERT_SET_IND( v, c )
#define VERT_COPY_IND( v0, v1 )
-#define VERT_SAVE_IND( idx )
-#define VERT_RESTORE_IND( idx )
+#define VERT_SAVE_IND( idx )
+#define VERT_RESTORE_IND( idx )
#endif
#if !HAVE_SPEC
-#define VERT_SET_SPEC( v, c )
+#define VERT_SET_SPEC( v, c )
#define VERT_COPY_SPEC( v0, v1 )
-#define VERT_SAVE_SPEC( idx )
-#define VERT_RESTORE_SPEC( idx )
+#define VERT_SAVE_SPEC( idx )
+#define VERT_RESTORE_SPEC( idx )
#endif
-static void TAG(unfilled_tri)( GLcontext *ctx,
+static void TAG(unfilled_tri)( GLcontext *ctx,
GLenum mode,
GLuint e0, GLuint e1, GLuint e2 )
{
VERT_SAVE_RGBA(1);
VERT_COPY_RGBA(v[0], v[2]);
VERT_COPY_RGBA(v[1], v[2]);
-
+
if (HAVE_SPEC) {
VERT_SAVE_SPEC(0);
VERT_SAVE_SPEC(1);
if (mode == GL_POINT) {
RASTERIZE(GL_POINTS);
- if (ef[e0]) POINT( v[0] );
- if (ef[e1]) POINT( v[1] );
- if (ef[e2]) POINT( v[2] );
+ if (ef[e0]) POINT( v[0] );
+ if (ef[e1]) POINT( v[1] );
+ if (ef[e2]) POINT( v[2] );
}
else {
RASTERIZE(GL_LINES);
if (RENDER_PRIMITIVE == GL_POLYGON) {
- if (ef[e2]) LINE( v[2], v[0] );
- if (ef[e0]) LINE( v[0], v[1] );
- if (ef[e1]) LINE( v[1], v[2] );
- }
+ if (ef[e2]) LINE( v[2], v[0] );
+ if (ef[e0]) LINE( v[0], v[1] );
+ if (ef[e1]) LINE( v[1], v[2] );
+ }
else {
- if (ef[e0]) LINE( v[0], v[1] );
- if (ef[e1]) LINE( v[1], v[2] );
- if (ef[e2]) LINE( v[2], v[0] );
+ if (ef[e0]) LINE( v[0], v[1] );
+ if (ef[e1]) LINE( v[1], v[2] );
+ if (ef[e2]) LINE( v[2], v[0] );
}
}
if (HAVE_RGBA) {
VERT_RESTORE_RGBA(0);
VERT_RESTORE_RGBA(1);
-
+
if (HAVE_SPEC) {
VERT_RESTORE_SPEC(0);
VERT_RESTORE_SPEC(1);
}
-static void TAG(unfilled_quad)( GLcontext *ctx,
+static void TAG(unfilled_quad)( GLcontext *ctx,
GLenum mode,
- GLuint e0, GLuint e1,
+ GLuint e0, GLuint e1,
GLuint e2, GLuint e3 )
{
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
VERT_COPY_RGBA(v[0], v[3]);
VERT_COPY_RGBA(v[1], v[3]);
VERT_COPY_RGBA(v[2], v[3]);
-
+
if (HAVE_SPEC) {
VERT_SAVE_SPEC(0);
VERT_SAVE_SPEC(1);
if (mode == GL_POINT) {
RASTERIZE(GL_POINTS);
- if (ef[e0]) POINT( v[0] );
- if (ef[e1]) POINT( v[1] );
- if (ef[e2]) POINT( v[2] );
- if (ef[e3]) POINT( v[3] );
+ if (ef[e0]) POINT( v[0] );
+ if (ef[e1]) POINT( v[1] );
+ if (ef[e2]) POINT( v[2] );
+ if (ef[e3]) POINT( v[3] );
}
else {
RASTERIZE(GL_LINES);
- if (ef[e0]) LINE( v[0], v[1] );
- if (ef[e1]) LINE( v[1], v[2] );
- if (ef[e2]) LINE( v[2], v[3] );
- if (ef[e3]) LINE( v[3], v[0] );
+ if (ef[e0]) LINE( v[0], v[1] );
+ if (ef[e1]) LINE( v[1], v[2] );
+ if (ef[e2]) LINE( v[2], v[3] );
+ if (ef[e3]) LINE( v[3], v[0] );
}
if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) {
VERT_RESTORE_RGBA(0);
VERT_RESTORE_RGBA(1);
VERT_RESTORE_RGBA(2);
-
+
if (HAVE_SPEC) {
VERT_RESTORE_SPEC(0);
VERT_RESTORE_SPEC(1);
+/* $Id: t_dd_vb.c,v 1.6 2001/03/12 00:48:44 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
- * Keith Whitwell <keithw@valinux.com>
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
*/
#if (HAVE_HW_VIEWPORT)
}
-void TAG(translate_vertex)(GLcontext *ctx,
- const VERTEX *src,
+void TAG(translate_vertex)(GLcontext *ctx,
+ const VERTEX *src,
SWvertex *dst)
{
GLuint format = GET_VERTEX_FORMAT();
dst->color[1] = src->tv.color.green;
dst->color[2] = src->tv.color.blue;
dst->color[3] = src->tv.color.alpha;
- }
+ }
else {
GLfloat oow = (HAVE_HW_DIVIDE) ? 1.0 / src->v.w : src->v.w;
dst->specular[0] = src->v.specular.red;
dst->specular[1] = src->v.specular.green;
dst->specular[2] = src->v.specular.blue;
-
+
dst->fog = src->v.color.alpha/255.0;
- if (HAVE_PTEX_VERTICES &&
+ if (HAVE_PTEX_VERTICES &&
((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) ||
(format == PROJ_TEX1_VERTEX_FORMAT))) {
}
#if 0
-static void
+static void
mga_translate_vertex( GLcontext *ctx, const mgaVertex *src, SWvertex *dst)
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
dst->win[1] = - src->v.y + mmesa->driDrawable->h + mmesa->drawY + SUBPIXEL_Y;
dst->win[2] = src->v.z / mmesa->depth_scale;
dst->win[3] = src->v.oow;
-
+
dst->color[0] = src->v.color.red;
dst->color[1] = src->v.color.green;
dst->color[2] = src->v.color.blue;
if (format == TINY_VERTEX_FORMAT) {
fprintf(stderr, "x %f y %f z %f\n", v->v.x, v->v.y, v->v.z);
- fprintf(stderr, "r %d g %d b %d a %d\n",
+ fprintf(stderr, "r %d g %d b %d a %d\n",
v->tv.color.red,
v->tv.color.green,
v->tv.color.blue,
v->tv.color.alpha);
- }
+ }
else {
- fprintf(stderr, "x %f y %f z %f oow %f\n",
+ fprintf(stderr, "x %f y %f z %f oow %f\n",
v->v.x, v->v.y, v->v.z, v->v.w);
- fprintf(stderr, "r %d g %d b %d a %d\n",
+ fprintf(stderr, "r %d g %d b %d a %d\n",
v->v.color.red,
v->v.color.green,
v->v.color.blue,
v->v.color.alpha);
}
-
+
fprintf(stderr, "\n");
}
+/* $Id: t_dd_vbtmp.h,v 1.8 2001/03/12 00:48:44 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
- * Keith Whitwell <keithw@valinux.com>
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
*/
* unsigned int ui[16];
* unsigned char ub4[4][16];
* }
- *
+ *
* DO_XYZW: Emit xyz and maybe w coordinates.
* DO_RGBA: Emit color.
*
* HAVE_HW_VIEWPORT: Hardware performs viewport transform.
* HAVE_HW_DIVIDE: Hardware performs perspective divide.
- *
+ *
* HAVE_TINY_VERTICES: Hardware understands v.tv format.
* HAVE_PTEX_VERTICES: Hardware understands v.pv format.
* HAVE_NOTEX_VERTICES: Hardware understands v.v format with texcount 0.
if (VB->TexCoordPtr[t0]) {
tc0_stride = VB->TexCoordPtr[t0]->stride;
tc0 = VB->TexCoordPtr[t0]->data;
- if (DO_PTEX)
+ if (DO_PTEX)
tc0_size = VB->TexCoordPtr[t0]->size;
}
else {
if (DO_TEX3)
if (tc3)
tc3 = (GLfloat (*)[4])((GLubyte *)tc3 + start * tc3_stride);
- if (DO_RGBA)
+ if (DO_RGBA)
STRIDE_4UB(col, start * col_stride);
- if (DO_SPEC)
+ if (DO_SPEC)
STRIDE_4UB(spec, start * spec_stride);
- if (DO_FOG)
+ if (DO_FOG)
STRIDE_F(fog, start * fog_stride);
}
for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) {
if (DO_XYZW) {
if (HAVE_HW_VIEWPORT || mask[i] == 0) {
- VIEWPORT_X(v->v.x, coord[0][0]);
- VIEWPORT_Y(v->v.y, coord[0][1]);
- VIEWPORT_Z(v->v.z, coord[0][2]);
- v->v.w = coord[0][3];
+ VIEWPORT_X(v->v.x, coord[0][0]);
+ VIEWPORT_Y(v->v.y, coord[0][1]);
+ VIEWPORT_Z(v->v.z, coord[0][2]);
+ v->v.w = coord[0][3];
}
coord = (GLfloat (*)[4])((GLubyte *)coord + coord_stride);
}
v->v.v0 = tc0[0][1];
if (DO_PTEX) {
if (HAVE_PTEX_VERTICES) {
- if (tc0_size == 4)
+ if (tc0_size == 4)
v->pv.q0 = tc0[0][3];
else
v->pv.q0 = 1.0;
- }
+ }
else if (tc0_size == 4) {
float rhw = 1.0 / tc0[0][3];
v->v.w *= tc0[0][3];
v->v.u0 *= rhw;
v->v.v0 *= rhw;
- }
- }
+ }
+ }
tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + tc0_stride);
}
}
if (DO_PTEX) {
v->pv.u1 = tc1[0][0];
v->pv.v1 = tc1[0][1];
- if (tc1_size == 4)
+ if (tc1_size == 4)
v->pv.q1 = tc1[0][3];
else
v->pv.q1 = 1.0;
- }
+ }
else {
v->v.u1 = tc1[0][0];
v->v.v1 = tc1[0][1];
}
tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + tc1_stride);
}
- }
+ }
else if (DO_PTEX) {
*(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */
}
if (DO_PTEX) {
v->pv.u2 = tc2[0][0];
v->pv.v2 = tc2[0][1];
- if (tc2_size == 4)
+ if (tc2_size == 4)
v->pv.q2 = tc2[0][3];
else
v->pv.q2 = 1.0;
- }
+ }
else {
v->v.u2 = tc2[0][0];
v->v.v2 = tc2[0][1];
}
tc2 = (GLfloat (*)[4])((GLubyte *)tc2 + tc2_stride);
}
- }
+ }
if (DO_TEX3) {
if (tc3) {
if (DO_PTEX) {
v->pv.u3 = tc3[0][0];
v->pv.v3 = tc3[0][1];
- if (tc3_size == 4)
+ if (tc3_size == 4)
v->pv.q3 = tc3[0][3];
else
v->pv.q3 = 1.0;
- }
+ }
else {
v->v.u3 = tc3[0][0];
v->v.v3 = tc3[0][1];
}
tc3 = (GLfloat (*)[4])((GLubyte *)tc3 + tc3_stride);
}
- }
+ }
}
}
else {
for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) {
if (DO_XYZW) {
if (HAVE_HW_VIEWPORT || mask[i] == 0) {
- VIEWPORT_X(v->v.x, coord[i][0]);
- VIEWPORT_Y(v->v.y, coord[i][1]);
- VIEWPORT_Z(v->v.z, coord[i][2]);
- v->v.w = coord[i][3];
+ VIEWPORT_X(v->v.x, coord[i][0]);
+ VIEWPORT_Y(v->v.y, coord[i][1]);
+ VIEWPORT_Z(v->v.z, coord[i][2]);
+ v->v.w = coord[i][3];
}
}
if (DO_RGBA) {
v->pv.u0 = tc0[i][0];
v->pv.v0 = tc0[i][1];
if (HAVE_PTEX_VERTICES) {
- if (tc0_size == 4)
+ if (tc0_size == 4)
v->pv.q0 = tc0[i][3];
else
v->pv.q0 = 1.0;
v->pv.q1 = 0; /* radeon */
- }
+ }
else if (tc0_size == 4) {
float rhw = 1.0 / tc0[i][3];
v->v.w *= tc0[i][3];
v->v.u0 *= rhw;
v->v.v0 *= rhw;
- }
- }
+ }
+ }
else {
v->v.u0 = tc0[i][0];
v->v.v0 = tc0[i][1];
if (DO_PTEX) {
v->pv.u1 = tc1[i][0];
v->pv.v1 = tc1[i][1];
- if (tc1_size == 4)
+ if (tc1_size == 4)
v->pv.q1 = tc1[i][3];
else
v->pv.q1 = 1.0;
- }
+ }
else {
v->v.u1 = tc1[i][0];
v->v.v1 = tc1[i][1];
}
}
}
-#else
+#else
#if DO_XYZW
#if HAVE_HW_DIVIDE
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLubyte (*col)[4] = VB->ColorPtr[0]->data;
GLuint col_stride = VB->ColorPtr[0]->stride;
- GLfloat (*coord)[4] = VB->ProjectedClipPtr->data;
+ GLfloat (*coord)[4] = VB->ProjectedClipPtr->data;
GLuint coord_stride = VB->ProjectedClipPtr->stride;
GLfloat *v = (GLfloat *)dest;
const GLubyte *mask = VB->ClipMask;
ASSERT(stride == 4);
/* Pack what's left into a 4-dword vertex. Color is in a different
- * place, and there is no 'w' coordinate.
+ * place, and there is no 'w' coordinate.
*/
if (VB->importable_data) {
if (start) {
for (i=start; i < end; i++, v+=4) {
if (HAVE_HW_VIEWPORT || mask[i] == 0) {
- VIEWPORT_X(v[0], coord[0][0]);
- VIEWPORT_Y(v[1], coord[0][1]);
- VIEWPORT_Z(v[2], coord[0][2]);
+ VIEWPORT_X(v[0], coord[0][0]);
+ VIEWPORT_Y(v[1], coord[0][1]);
+ VIEWPORT_Z(v[2], coord[0][2]);
}
coord = (GLfloat (*)[4])((GLubyte *)coord + coord_stride);
if (DO_RGBA) {
if (HAVE_RGBA_COLOR) {
*(GLuint *)&v[3] = *(GLuint *)col;
- }
+ }
else {
GLubyte *b = (GLubyte *)&v[3];
b[0] = col[0][2];
else {
for (i=start; i < end; i++, v+=4) {
if (HAVE_HW_VIEWPORT || mask[i] == 0) {
- VIEWPORT_X(v[0], coord[i][0]);
- VIEWPORT_Y(v[1], coord[i][1]);
- VIEWPORT_Z(v[2], coord[i][2]);
+ VIEWPORT_X(v[0], coord[i][0]);
+ VIEWPORT_Y(v[1], coord[i][1]);
+ VIEWPORT_Z(v[2], coord[i][2]);
}
if (DO_RGBA) {
if (HAVE_RGBA_COLOR) {
if (DO_PTEX)
return GL_TRUE;
-
+
if ((DO_TEX3 && VB->TexCoordPtr[3]->size == 4) ||
(DO_TEX2 && VB->TexCoordPtr[2]->size == 4) ||
(DO_TEX1 && VB->TexCoordPtr[1]->size == 4) ||
(DO_TEX0 && VB->TexCoordPtr[0]->size == 4))
return GL_FALSE;
-
+
return GL_TRUE;
}
#else
if (DO_TEX1 && VB->TexCoordPtr[0] == 0)
VB->TexCoordPtr[0] = VB->TexCoordPtr[1];
- if (DO_PTEX)
+ if (DO_PTEX)
return GL_TRUE;
-
+
/* No hardware support for projective texture. Can fake it for
- * TEX0 only.
+ * TEX0 only.
*/
if ((DO_TEX3 && VB->TexCoordPtr[3]->size == 4) ||
(DO_TEX2 && VB->TexCoordPtr[2]->size == 4) ||
static void TAG(interp)( GLcontext *ctx,
- GLfloat t,
+ GLfloat t,
GLuint edst, GLuint eout, GLuint ein,
GLboolean force_boundary )
{
(void)s;
-
+
if (!HAVE_HW_DIVIDE) {
w = 1.0 / dstclip[3];
- VIEWPORT_X( dst->v.x, dstclip[0] * w );
- VIEWPORT_Y( dst->v.y, dstclip[1] * w );
- VIEWPORT_Z( dst->v.z, dstclip[2] * w );
- }
+ VIEWPORT_X( dst->v.x, dstclip[0] * w );
+ VIEWPORT_Y( dst->v.y, dstclip[1] * w );
+ VIEWPORT_Z( dst->v.z, dstclip[2] * w );
+ }
else {
- VIEWPORT_X( dst->v.x, dstclip[0] );
- VIEWPORT_Y( dst->v.y, dstclip[1] );
- VIEWPORT_Z( dst->v.z, dstclip[2] );
- w = dstclip[3];
+ VIEWPORT_X( dst->v.x, dstclip[0] );
+ VIEWPORT_Y( dst->v.y, dstclip[1] );
+ VIEWPORT_Z( dst->v.z, dstclip[2] );
+ w = dstclip[3];
}
- if (HAVE_HW_DIVIDE || DO_FOG || DO_SPEC || DO_TEX0 || DO_TEX1 ||
+ if (HAVE_HW_DIVIDE || DO_FOG || DO_SPEC || DO_TEX0 || DO_TEX1 ||
DO_TEX2 || DO_TEX3) {
- dst->v.w = w;
-
+ dst->v.w = w;
+
INTERP_UB( t, dst->ub4[4][0], out->ub4[4][0], in->ub4[4][0] );
INTERP_UB( t, dst->ub4[4][1], out->ub4[4][1], in->ub4[4][1] );
INTERP_UB( t, dst->ub4[4][2], out->ub4[4][2], in->ub4[4][2] );
GLfloat qdst, rqdst;
ASSERT( !HAVE_HW_DIVIDE );
-
+
INTERP_F( t, dst->v.u0, out->v.u0 * qout, in->v.u0 * qin );
INTERP_F( t, dst->v.v0, out->v.v0 * qout, in->v.v0 * qin );
INTERP_F( t, qdst, qout, qin );
-
+
rqdst = 1.0 / qdst;
dst->v.u0 *= rqdst;
dst->v.v0 *= rqdst;
dst->v.w *= rqdst;
}
- }
+ }
else {
INTERP_F( t, dst->v.u0, out->v.u0, in->v.u0 );
INTERP_F( t, dst->v.v0, out->v.v0, in->v.v0 );
static void TAG(init)( void )
{
setup_tab[IND].emit = TAG(emit);
-
+
#if (DO_XYZW && DO_RGBA)
setup_tab[IND].check_tex_sizes = TAG(check_tex_sizes);
setup_tab[IND].interp = TAG(interp);
#endif
-
+
if (DO_SPEC)
setup_tab[IND].copy_pv = copy_pv_rgba4_spec5;
else if (HAVE_HW_DIVIDE || DO_SPEC || DO_FOG || DO_TEX0 || DO_TEX1 ||
ASSERT(HAVE_PTEX_VERTICES);
setup_tab[IND].vertex_format = PROJ_TEX3_VERTEX_FORMAT;
setup_tab[IND].vertex_size = 18;
- setup_tab[IND].vertex_stride_shift = 7;
+ setup_tab[IND].vertex_stride_shift = 7;
}
else {
setup_tab[IND].vertex_format = TEX3_VERTEX_FORMAT;
setup_tab[IND].vertex_size = 14;
- setup_tab[IND].vertex_stride_shift = 6;
+ setup_tab[IND].vertex_stride_shift = 6;
}
- }
+ }
else if (DO_TEX2) {
if (DO_PTEX) {
ASSERT(HAVE_PTEX_VERTICES);
setup_tab[IND].vertex_format = PROJ_TEX3_VERTEX_FORMAT;
setup_tab[IND].vertex_size = 18;
- setup_tab[IND].vertex_stride_shift = 7;
+ setup_tab[IND].vertex_stride_shift = 7;
}
else {
setup_tab[IND].vertex_format = TEX2_VERTEX_FORMAT;
setup_tab[IND].vertex_size = 12;
- setup_tab[IND].vertex_stride_shift = 6;
+ setup_tab[IND].vertex_stride_shift = 6;
}
- }
+ }
else if (DO_TEX1) {
if (DO_PTEX) {
ASSERT(HAVE_PTEX_VERTICES);
setup_tab[IND].vertex_format = PROJ_TEX1_VERTEX_FORMAT;
setup_tab[IND].vertex_size = 12;
- setup_tab[IND].vertex_stride_shift = 6;
+ setup_tab[IND].vertex_stride_shift = 6;
}
else {
setup_tab[IND].vertex_format = TEX1_VERTEX_FORMAT;
setup_tab[IND].vertex_size = 10;
- setup_tab[IND].vertex_stride_shift = 6;
+ setup_tab[IND].vertex_stride_shift = 6;
}
- }
+ }
else if (DO_TEX0) {
if (DO_PTEX && HAVE_PTEX_VERTICES) {
setup_tab[IND].vertex_format = PROJ_TEX1_VERTEX_FORMAT;
setup_tab[IND].vertex_size = 12;
- setup_tab[IND].vertex_stride_shift = 6;
+ setup_tab[IND].vertex_stride_shift = 6;
} else {
setup_tab[IND].vertex_format = TEX0_VERTEX_FORMAT;
setup_tab[IND].vertex_size = 8;
- setup_tab[IND].vertex_stride_shift = 5;
+ setup_tab[IND].vertex_stride_shift = 5;
}
}
else if (!HAVE_HW_DIVIDE && !DO_SPEC && !DO_FOG && HAVE_TINY_VERTICES) {
setup_tab[IND].vertex_format = TINY_VERTEX_FORMAT;
setup_tab[IND].vertex_size = 4;
- setup_tab[IND].vertex_stride_shift = 4;
+ setup_tab[IND].vertex_stride_shift = 4;
} else if (HAVE_NOTEX_VERTICES) {
setup_tab[IND].vertex_format = NOTEX_VERTEX_FORMAT;
setup_tab[IND].vertex_size = 6;
} else {
setup_tab[IND].vertex_format = TEX0_VERTEX_FORMAT;
setup_tab[IND].vertex_size = 8;
- setup_tab[IND].vertex_stride_shift = 5;
+ setup_tab[IND].vertex_stride_shift = 5;
}
assert(setup_tab[IND].vertex_size * 4 <=
+/* $Id: t_dd_vertex.h,v 1.5 2001/03/12 00:48:44 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
- * Keith Whitwell <keithw@valinux.com>
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
*/
#ifdef COLOR_IS_RGBA
-/* $Id: glapi.c,v 1.50 2001/03/07 05:06:11 brianp Exp $ */
+/* $Id: glapi.c,v 1.51 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
}
#endif
}
-
-
-
-
-/* $Id: glapitemp.h,v 1.24 2000/12/26 05:09:28 keithw Exp $ */
+/* $Id: glapitemp.h,v 1.25 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
{
DISPATCH(TexCoord4fv, (v), (F, ";"));
}
-
+
KEYWORD1 void KEYWORD2 NAME(TexCoord4iv)(const GLint *v)
{
DISPATCH(TexCoord4iv, (v), (F, ";"));
#ifdef DO_INIT
-static void NAME(InitDispatch)( void )
+static void NAME(InitDispatch)( void )
{
INITARGS;
INIT(GetCompressedTexImageARB);
-/* $Id: glthread.c,v 1.7 2001/03/07 05:06:11 brianp Exp $ */
+/* $Id: glthread.c,v 1.8 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
#include "all.h"
#else
#include "glheader.h"
-#include "glthread.h"
+#include "glthread.h"
#endif
/*
- * Solaris/Unix International Threads -- Use only if POSIX threads
+ * Solaris/Unix International Threads -- Use only if POSIX threads
* aren't available on your Unix platform. Solaris 2.[34] are examples
- * of platforms where this is the case. Be sure to use -mt and/or
+ * of platforms where this is the case. Be sure to use -mt and/or
* -D_REENTRANT when compiling.
*/
#ifdef SOLARIS_THREADS
#ifdef USE_LOCK_FOR_KEY
mutex_lock(&tsd->keylock);
thr_getspecific(tsd->key, &ret);
- mutex_unlock(&tsd->keylock);
+ mutex_unlock(&tsd->keylock);
#else
if ((errno = thr_getspecific(tsd->key, &ret)) != 0) {
perror(GET_TSD_ERROR);
* Win32 Threads. The only available option for Windows 95/NT.
* Be sure that you compile using the Multithreaded runtime, otherwise
* bad things will happen.
- */
+ */
#ifdef WIN32_THREADS
unsigned long
-/* $Id: glthread.h,v 1.7 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: glthread.h,v 1.8 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#endif /* THREADS_H */
-
-/* $Id: accum.c,v 1.36 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: accum.c,v 1.37 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: accum.h,v 1.5 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: accum.h,v 1.6 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
+/* $Id: api_arrayelt.c,v 1.2 2001/03/12 00:48:37 gareth Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
#include "glheader.h"
#include "api_noop.h"
#include "context.h"
struct gl_client_array *array;
void *func;
} AAtexarray;
-
+
typedef struct {
struct gl_client_array *array;
AAarray *aa = actx->arrays;
int i;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if (ctx->Array.TexCoord[i].Enabled) {
ta->unit = i;
ta->array = &ctx->Array.TexCoord[i];
AAarray *aa;
for (ta = actx->texarrays ; ta->func ; ta++) {
- void (*func)( GLint, const void * ) =
- (void (*)( GLint, const void * )) ta->func;
+ void (*func)( GLint, const void * ) =
+ (void (*)( GLint, const void * )) ta->func;
func( ta->unit, (char *)ta->array->Ptr + elt * ta->array->SizeB );
}
for (aa = actx->arrays ; aa->func ; aa++) {
- void (*func)( GLint, const void * ) =
- (void (*)( GLint, const void * )) aa->func;
+ void (*func)( GLint, const void * ) =
+ (void (*)( GLint, const void * )) aa->func;
func( (char *)aa->array->Ptr + elt * aa->array->SizeB );
}
}
{
GET_CURRENT_CONTEXT(ctx);
AAcontext *actx = AA_CONTEXT(ctx);
-
- if (actx->NewState)
+
+ if (actx->NewState)
_aa_update_state( ctx );
ctx->Exec->ArrayElement = _aa_loopback_array_elt;
{
GET_CURRENT_CONTEXT(ctx);
AAcontext *actx = AA_CONTEXT(ctx);
-
- if (actx->NewState)
+
+ if (actx->NewState)
_aa_update_state( ctx );
ctx->Save->ArrayElement = _aa_loopback_array_elt;
void aa_invalidate_state( GLcontext *ctx, GLuint new_state )
{
- if (AA_CONTEXT(ctx))
+ if (AA_CONTEXT(ctx))
AA_CONTEXT(ctx)->NewState |= new_state;
}
-/* $Id: api_loopback.c,v 1.6 2001/01/02 22:05:55 brianp Exp $ */
+/* $Id: api_loopback.c,v 1.7 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
+ *
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keithw@valinux.com>
*/
#define TEXCOORD2(s,t) DRIVER(TexCoord2f)(s,t)
#define TEXCOORD3(s,t,u) DRIVER(TexCoord3f)(s,t,u)
#define TEXCOORD4(s,t,u,v) DRIVER(TexCoord4f)(s,t,u,v)
-#define INDEX(c) DRIVER(Indexi)(c)
-#define MULTI_TEXCOORD1(z,s) DRIVER(MultiTexCoord1fARB)(z,s)
+#define INDEX(c) DRIVER(Indexi)(c)
+#define MULTI_TEXCOORD1(z,s) DRIVER(MultiTexCoord1fARB)(z,s)
#define MULTI_TEXCOORD2(z,s,t) DRIVER(MultiTexCoord2fARB)(z,s,t)
-#define MULTI_TEXCOORD3(z,s,t,u) DRIVER(MultiTexCoord3fARB)(z,s,t,u)
+#define MULTI_TEXCOORD3(z,s,t,u) DRIVER(MultiTexCoord3fARB)(z,s,t,u)
#define MULTI_TEXCOORD4(z,s,t,u,v) DRIVER(MultiTexCoord4fARB)(z,s,t,u,v)
#define EVALCOORD1(x) DRIVER(EvalCoord1f)(x)
#define EVALCOORD2(x,y) DRIVER(EvalCoord2f)(x,y)
}
static void
-loopback_Color4s( GLshort red, GLshort green, GLshort blue,
+loopback_Color4s( GLshort red, GLshort green, GLshort blue,
GLshort alpha )
{
GLubyte col[4];
}
static void
-loopback_Color4us( GLushort red, GLushort green, GLushort blue,
+loopback_Color4us( GLushort red, GLushort green, GLushort blue,
GLushort alpha )
{
GLubyte col[4];
static void
loopback_Color3sv( const GLshort *v )
-{
+{
GLubyte col[4];
col[0] = SHORT_TO_UBYTE(v[0]);
col[1] = SHORT_TO_UBYTE(v[1]);
static void
loopback_Color3b_f( GLbyte red, GLbyte green, GLbyte blue )
{
- COLORF( BYTE_TO_FLOAT(red),
+ COLORF( BYTE_TO_FLOAT(red),
BYTE_TO_FLOAT(green),
- BYTE_TO_FLOAT(blue),
+ BYTE_TO_FLOAT(blue),
1.0 );
}
static void
-loopback_Color4b_f( GLbyte red, GLbyte green, GLbyte blue,
+loopback_Color4b_f( GLbyte red, GLbyte green, GLbyte blue,
GLbyte alpha )
{
COLORF( BYTE_TO_FLOAT(red), BYTE_TO_FLOAT(green),
}
static void
-loopback_Color4s_f( GLshort red, GLshort green, GLshort blue,
+loopback_Color4s_f( GLshort red, GLshort green, GLshort blue,
GLshort alpha )
{
COLORF( SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green),
static void
loopback_Vertex4dv( const GLdouble *v )
{
- VERTEX4( (GLfloat) v[0], (GLfloat) v[1],
+ VERTEX4( (GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3] );
}
static void
loopback_Vertex4iv( const GLint *v )
{
- VERTEX4( (GLfloat) v[0], (GLfloat) v[1],
+ VERTEX4( (GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3] );
}
static void
loopback_Vertex4sv( const GLshort *v )
{
- VERTEX4( (GLfloat) v[0], (GLfloat) v[1],
+ VERTEX4( (GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3] );
}
void
-_mesa_loopback_prefer_float( struct _glapi_table *dest,
+_mesa_loopback_prefer_float( struct _glapi_table *dest,
GLboolean prefer_float_colors )
{
if (!prefer_float_colors) {
dest->SecondaryColor3svEXT = loopback_SecondaryColor3svEXT;
dest->SecondaryColor3uivEXT = loopback_SecondaryColor3uivEXT;
dest->SecondaryColor3usvEXT = loopback_SecondaryColor3usvEXT;
- }
+ }
else {
dest->Color3b = loopback_Color3b_f;
dest->Color3d = loopback_Color3d_f;
/* Passing prefer_f_colors as true will mean that all colors
* *except* Color{34}ub{v} are passed as floats. Setting it false will
- * mean all colors *except* Color{34}f{v} are passed as ubytes.
- *
+ * mean all colors *except* Color{34}f{v} are passed as ubytes.
+ *
* This code never registers handlers for any of the entry points
- * listed in vtxfmt.h.
+ * listed in vtxfmt.h.
*/
void
-_mesa_loopback_init_api_table( struct _glapi_table *dest,
+_mesa_loopback_init_api_table( struct _glapi_table *dest,
GLboolean prefer_float_colors )
{
_mesa_loopback_prefer_float( dest, prefer_float_colors );
+/* $Id: api_loopback.h,v 1.2 2001/03/12 00:48:37 gareth Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
#ifndef API_LOOPBACK_H
#define API_LOOPBACK_H
struct _glapi_table;
-extern void _mesa_loopback_prefer_float( struct _glapi_table *dest,
+extern void _mesa_loopback_prefer_float( struct _glapi_table *dest,
GLboolean prefer_float_colors );
-extern void _mesa_loopback_init_api_table( struct _glapi_table *dest,
+extern void _mesa_loopback_init_api_table( struct _glapi_table *dest,
GLboolean prefer_float_colors );
#endif
+/* $Id: api_noop.h,v 1.3 2001/03/12 00:48:37 gareth Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
#ifndef _API_NOOP_H
#define _API_NOOP_H
extern void _mesa_noop_MultiTexCoord1fvARB( GLenum target, GLfloat *v );
-extern void _mesa_noop_MultiTexCoord2fARB( GLenum target, GLfloat a,
+extern void _mesa_noop_MultiTexCoord2fARB( GLenum target, GLfloat a,
GLfloat b );
extern void _mesa_noop_MultiTexCoord2fvARB( GLenum target, GLfloat *v );
-extern void _mesa_noop_MultiTexCoord3fARB( GLenum target, GLfloat a,
+extern void _mesa_noop_MultiTexCoord3fARB( GLenum target, GLfloat a,
GLfloat b, GLfloat c);
extern void _mesa_noop_MultiTexCoord3fvARB( GLenum target, GLfloat *v );
-extern void _mesa_noop_MultiTexCoord4fARB( GLenum target, GLfloat a,
+extern void _mesa_noop_MultiTexCoord4fARB( GLenum target, GLfloat a,
GLfloat b, GLfloat c, GLfloat d );
extern void _mesa_noop_MultiTexCoord4fvARB( GLenum target, GLfloat *v );
/* Not strictly a noop -- translate Rectf down to Begin/End and
* vertices. Closer to the loopback operations, but doesn't meet the
- * criteria for inclusion there (cannot be used in the Save table).
+ * criteria for inclusion there (cannot be used in the Save table).
*/
extern void _mesa_noop_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
extern void _mesa_noop_DrawArrays(GLenum mode, GLint start, GLsizei count);
-extern void _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type,
+extern void _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices);
-extern void _mesa_noop_DrawRangeElements(GLenum mode,
- GLuint start, GLuint end,
- GLsizei count, GLenum type,
+extern void _mesa_noop_DrawRangeElements(GLenum mode,
+ GLuint start, GLuint end,
+ GLsizei count, GLenum type,
const GLvoid *indices);
-
-/* $Id: api_validate.c,v 1.4 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: api_validate.c,v 1.5 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
GLboolean
_mesa_validate_DrawElements(GLcontext *ctx,
- GLenum mode, GLsizei count, GLenum type,
+ GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices)
{
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
if (count <= 0) {
if (count < 0)
return GL_FALSE;
}
- if (mode < 0 ||
+ if (mode < 0 ||
mode > GL_POLYGON) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawArrays(mode)" );
return GL_FALSE;
}
- if (type != GL_UNSIGNED_INT &&
- type != GL_UNSIGNED_BYTE &&
+ if (type != GL_UNSIGNED_INT &&
+ type != GL_UNSIGNED_BYTE &&
type != GL_UNSIGNED_SHORT)
{
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
GLboolean
-_mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
- GLuint start, GLuint end,
- GLsizei count, GLenum type,
+_mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
+ GLuint start, GLuint end,
+ GLsizei count, GLenum type,
const GLvoid *indices)
{
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
if (count <= 0) {
if (count < 0)
return GL_FALSE;
}
- if (type != GL_UNSIGNED_INT &&
- type != GL_UNSIGNED_BYTE &&
+ if (type != GL_UNSIGNED_INT &&
+ type != GL_UNSIGNED_BYTE &&
type != GL_UNSIGNED_SHORT)
{
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
GLboolean
-_mesa_validate_DrawArrays(GLcontext *ctx,
+_mesa_validate_DrawArrays(GLcontext *ctx,
GLenum mode, GLint start, GLsizei count)
{
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
if (count<0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glDrawArrays(count)" );
if (ctx->NewState)
_mesa_update_state( ctx );
- if (!ctx->Array.Vertex.Enabled)
+ if (!ctx->Array.Vertex.Enabled)
return GL_FALSE;
return GL_TRUE;
}
-
-/* $Id: api_validate.h,v 1.1 2000/12/26 05:09:27 keithw Exp $ */
+/* $Id: api_validate.h,v 1.2 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
extern GLboolean
_mesa_validate_DrawElements(GLcontext *ctx,
- GLenum mode, GLsizei count, GLenum type,
+ GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices);
extern GLboolean
-_mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
- GLuint start, GLuint end,
- GLsizei count, GLenum type,
+_mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
+ GLuint start, GLuint end,
+ GLsizei count, GLenum type,
const GLvoid *indices);
-/* $Id: attrib.c,v 1.45 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: attrib.c,v 1.46 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
attr = next;
}
}
-
-
-
-/* $Id: attrib.h,v 1.4 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: attrib.h,v 1.5 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: blend.c,v 1.30 2001/03/07 00:21:32 brianp Exp $ */
+/* $Id: blend.c,v 1.31 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
void
_mesa_BlendFunc( GLenum sfactor, GLenum dfactor )
{
-
+
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
ctx->Color.BlendDstRGB = ctx->Color.BlendDstA = dfactor;
ctx->Color.BlendSrcRGB = ctx->Color.BlendSrcA = sfactor;
- if (ctx->Driver.BlendFunc)
+ if (ctx->Driver.BlendFunc)
ctx->Driver.BlendFunc( ctx, sfactor, dfactor );
}
/* This is needed to support 1.1's RGB logic ops AND
* 1.0's blending logicops.
*/
- ctx->Color.ColorLogicOpEnabled = (mode==GL_LOGIC_OP &&
+ ctx->Color.ColorLogicOpEnabled = (mode==GL_LOGIC_OP &&
ctx->Color.BlendEnabled);
if (ctx->Driver.BlendEquation)
if (ctx->Driver.BlendColor)
(*ctx->Driver.BlendColor)(ctx, tmp);
}
-
-/* $Id: blend.h,v 1.7 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: blend.h,v 1.8 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: buffers.c,v 1.27 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: buffers.c,v 1.28 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
if (ctx->Color.ClearIndex == (GLuint) c)
return;
-
+
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.ClearIndex = (GLuint) c;
-/* $Id: buffers.h,v 1.2 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: buffers.h,v 1.3 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: clip.c,v 1.21 2001/03/07 05:06:11 brianp Exp $ */
+/* $Id: clip.c,v 1.22 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
if (TEST_EQ_4V(ctx->Transform.EyeUserPlane[p], equation))
return;
-
+
FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
COPY_4FV(ctx->Transform.EyeUserPlane[p], equation);
-/* $Id: clip.h,v 1.5 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: clip.h,v 1.6 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: colortab.c,v 1.36 2001/03/07 05:06:11 brianp Exp $ */
+/* $Id: colortab.c,v 1.37 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-void
+void
_mesa_ColorTable( GLenum target, GLenum internalFormat,
GLsizei width, GLenum format, GLenum type,
const GLvoid *data )
(*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
}
}
-
+
ctx->NewState |= _NEW_PIXEL;
}
(*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
}
}
-
+
ctx->NewState |= _NEW_PIXEL;
}
-/* $Id: colortab.h,v 1.8 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: colortab.h,v 1.9 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: config.h,v 1.26 2000/12/28 22:11:05 keithw Exp $ */
+/* $Id: config.h,v 1.27 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/* $Id: context.h,v 1.24 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: context.h,v 1.25 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: convolve.c,v 1.21 2001/03/07 05:06:11 brianp Exp $ */
+/* $Id: convolve.c,v 1.22 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
ctx->Unpack.SkipImages = 0;
ctx->Unpack.SwapBytes = GL_FALSE;
ctx->Unpack.LsbFirst = GL_FALSE;
- ctx->NewState |= _NEW_PACKUNPACK;
+ ctx->NewState |= _NEW_PACKUNPACK;
_mesa_ConvolutionFilter2D(target, internalFormat, width, height,
GL_RGBA, CHAN_TYPE, rgba);
ctx->Unpack = packSave; /* restore pixel packing params */
- ctx->NewState |= _NEW_PACKUNPACK;
+ ctx->NewState |= _NEW_PACKUNPACK;
}
*height = *height - (MAX2(ctx->Separable2D.Height, 1) - 1);
}
}
-
-/* $Id: dd.h,v 1.57 2001/03/11 18:49:11 gareth Exp $ */
+/* $Id: dd.h,v 1.58 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
+/* $Id: debug.c,v 1.9 2001/03/12 00:48:37 gareth Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
#include "mtypes.h"
#include "debug.h"
+/* $Id: debug.h,v 1.3 2001/03/12 00:48:37 gareth Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
#ifndef _DEBUG_H
#define _DEBUG_H
-/* $Id: depth.c,v 1.26 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: depth.c,v 1.27 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
return;
}
- if (ctx->Depth.Func == func)
+ if (ctx->Depth.Func == func)
return;
-
+
FLUSH_VERTICES(ctx, _NEW_DEPTH);
ctx->Depth.Func = func;
else
ctx->_TriangleCaps &= ~DD_Z_NEVER;
- if (ctx->Driver.DepthFunc)
+ if (ctx->Driver.DepthFunc)
ctx->Driver.DepthFunc( ctx, func );
}
* GL_TRUE indicates depth buffer writing is enabled (default)
* GL_FALSE indicates depth buffer writing is disabled
*/
- if (ctx->Depth.Mask == flag)
+ if (ctx->Depth.Mask == flag)
return;
-
+
FLUSH_VERTICES(ctx, _NEW_DEPTH);
ctx->Depth.Mask = flag;
- if (ctx->Driver.DepthMask)
+ if (ctx->Driver.DepthMask)
ctx->Driver.DepthMask( ctx, flag );
}
-
-
-/* $Id: depth.h,v 1.10 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: depth.h,v 1.11 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: dispatch.c,v 1.19 2001/01/08 04:09:41 keithw Exp $ */
+/* $Id: dispatch.c,v 1.20 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#define DO_GEOMETRY
#include "glapitemp.h"
-
-/* $Id: dlist.c,v 1.66 2001/03/07 05:06:11 brianp Exp $ */
+/* $Id: dlist.c,v 1.67 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
/*
- * End definition of current display list. Is the current
+ * End definition of current display list. Is the current
* ASSERT_OUTSIDE_BEGIN_END strong enough to really guarentee that
* we are outside begin/end calls?
*/
ctx->Exec->GetTexLevelParameteriv( target, level, pname, params );
}
-static void exec_GetTexParameterfv( GLenum target, GLenum pname,
+static void exec_GetTexParameterfv( GLenum target, GLenum pname,
GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
return ctx->Exec->AreTexturesResident( n, texName, residences);
}
-static void exec_ColorPointer(GLint size, GLenum type, GLsizei stride,
+static void exec_ColorPointer(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->IndexPointer( type, stride, ptr);
}
-static void exec_InterleavedArrays(GLenum format, GLsizei stride,
+static void exec_InterleavedArrays(GLenum format, GLsizei stride,
const GLvoid *pointer)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->PushClientAttrib( mask);
}
-static void exec_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
+static void exec_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->TexCoordPointer( size, type, stride, ptr);
}
-static void exec_GetCompressedTexImageARB(GLenum target, GLint level,
+static void exec_GetCompressedTexImageARB(GLenum target, GLint level,
GLvoid *img)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetCompressedTexImageARB( target, level, img);
}
-static void exec_VertexPointer(GLint size, GLenum type, GLsizei stride,
+static void exec_VertexPointer(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->VertexPointer( size, type, stride, ptr);
}
-static void exec_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat,
+static void exec_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat,
GLint x, GLint y, GLsizei width)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetColorTable( target, format, type, data );
}
-static void exec_GetColorTableParameterfv( GLenum target, GLenum pname,
+static void exec_GetColorTableParameterfv( GLenum target, GLenum pname,
GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetColorTableParameterfv( target, pname, params );
}
-static void exec_GetColorTableParameteriv( GLenum target, GLenum pname,
+static void exec_GetColorTableParameteriv( GLenum target, GLenum pname,
GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetConvolutionFilter( target, format, type, image);
}
-static void exec_GetConvolutionParameterfv(GLenum target, GLenum pname,
+static void exec_GetConvolutionParameterfv(GLenum target, GLenum pname,
GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetConvolutionParameteriv( target, pname, params);
}
-static void exec_GetHistogram(GLenum target, GLboolean reset, GLenum format,
+static void exec_GetHistogram(GLenum target, GLboolean reset, GLenum format,
GLenum type, GLvoid *values)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetHistogram( target, reset, format, type, values);
}
-static void exec_GetHistogramParameterfv(GLenum target, GLenum pname,
+static void exec_GetHistogramParameterfv(GLenum target, GLenum pname,
GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetHistogramParameterfv( target, pname, params);
}
-static void exec_GetHistogramParameteriv(GLenum target, GLenum pname,
+static void exec_GetHistogramParameteriv(GLenum target, GLenum pname,
GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetHistogramParameteriv( target, pname, params);
}
-static void exec_GetMinmax(GLenum target, GLboolean reset, GLenum format,
+static void exec_GetMinmax(GLenum target, GLboolean reset, GLenum format,
GLenum type, GLvoid *values)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetMinmaxParameteriv( target, pname, params);
}
-static void exec_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
+static void exec_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
GLvoid *row, GLvoid *column, GLvoid *span)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->SecondaryColorPointerEXT( size, type, stride, ptr);
}
-static void exec_FogCoordPointerEXT(GLenum type, GLsizei stride,
+static void exec_FogCoordPointerEXT(GLenum type, GLsizei stride,
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
-/* $Id: dlist.h,v 1.13 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: dlist.h,v 1.14 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
void (*destroy)( GLcontext *, void * ),
void (*print)( GLcontext *, void * ) );
-extern void _mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2,
+extern void _mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2,
GLint j1, GLint j2 );
extern void _mesa_save_EvalMesh1( GLenum mode, GLint i1, GLint i2 );
extern void _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists );
-/* $Id: drawpix.c,v 1.49 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: drawpix.c,v 1.50 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
}
}
}
-
-/* $Id: drawpix.h,v 1.5 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: drawpix.h,v 1.6 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: enable.c,v 1.44 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: enable.c,v 1.45 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
var = &ctx->Array.Index.Enabled;
flag = _NEW_ARRAY_INDEX;
break;
- case GL_TEXTURE_COORD_ARRAY:
+ case GL_TEXTURE_COORD_ARRAY:
var = &ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled;
flag = _NEW_ARRAY_TEXCOORD(ctx->Array.ActiveTexture);
break;
ctx->Array.NewState |= flag;
*var = state;
- if (state)
+ if (state)
ctx->Array._Enabled |= flag;
else
ctx->Array._Enabled &= ~flag;
switch (cap) {
case GL_ALPHA_TEST:
- if (ctx->Color.AlphaEnabled == state)
+ if (ctx->Color.AlphaEnabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.AlphaEnabled = state;
ctx->Eval.AutoNormal = state;
break;
case GL_BLEND:
- if (ctx->Color.BlendEnabled == state)
+ if (ctx->Color.BlendEnabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.BlendEnabled = state;
/* The following needed to accomodate 1.0 RGB logic op blending */
- ctx->Color.ColorLogicOpEnabled =
+ ctx->Color.ColorLogicOpEnabled =
(ctx->Color.BlendEquation == GL_LOGIC_OP && state);
break;
case GL_CLIP_PLANE0:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5: {
GLuint p = cap-GL_CLIP_PLANE0;
-
+
if (ctx->Transform.ClipEnabled[p] == state)
return;
if (state) {
ctx->_Enabled |= ENABLE_USERCLIP;
ctx->Transform._AnyClip++;
-
+
if (ctx->ProjectionMatrix.flags & MAT_DIRTY) {
_math_matrix_analyse( &ctx->ProjectionMatrix );
}
-
+
/* This derived state also calculated in clip.c and
* from _mesa_update_state() on changes to EyeUserPlane
* and ctx->ProjectionMatrix respectively.
ctx->ProjectionMatrix.inv );
} else {
if (--ctx->Transform._AnyClip == 0)
- ctx->_Enabled &= ~ENABLE_USERCLIP;
- }
+ ctx->_Enabled &= ~ENABLE_USERCLIP;
+ }
}
break;
case GL_COLOR_MATERIAL:
- if (ctx->Light.ColorMaterialEnabled == state)
+ if (ctx->Light.ColorMaterialEnabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.ColorMaterialEnabled = state;
}
break;
case GL_CULL_FACE:
- if (ctx->Polygon.CullFlag == state)
+ if (ctx->Polygon.CullFlag == state)
return;
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.CullFlag = state;
_mesa_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer");
return;
}
- if (ctx->Depth.Test==state)
+ if (ctx->Depth.Test==state)
return;
FLUSH_VERTICES(ctx, _NEW_DEPTH);
ctx->Depth.Test = state;
if (ctx->NoDither) {
state = GL_FALSE; /* MESA_NO_DITHER env var */
}
- if (ctx->Color.DitherFlag==state)
+ if (ctx->Color.DitherFlag==state)
return;
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.DitherFlag = state;
break;
case GL_FOG:
- if (ctx->Fog.Enabled==state)
+ if (ctx->Fog.Enabled==state)
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
ctx->Fog.Enabled = state;
case GL_LIGHT5:
case GL_LIGHT6:
case GL_LIGHT7:
- if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state)
+ if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Light[cap-GL_LIGHT0].Enabled = state;
}
break;
case GL_LIGHTING:
- if (ctx->Light.Enabled == state)
+ if (ctx->Light.Enabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Enabled = state;
if ((ctx->Light.Enabled &&
ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
|| ctx->Fog.ColorSumEnabled)
- ctx->_TriangleCaps |= DD_SEPERATE_SPECULAR;
+ ctx->_TriangleCaps |= DD_SEPERATE_SPECULAR;
else
- ctx->_TriangleCaps &= ~DD_SEPERATE_SPECULAR;
+ ctx->_TriangleCaps &= ~DD_SEPERATE_SPECULAR;
break;
case GL_LINE_SMOOTH:
- if (ctx->Line.SmoothFlag == state)
+ if (ctx->Line.SmoothFlag == state)
return;
FLUSH_VERTICES(ctx, _NEW_LINE);
ctx->Line.SmoothFlag = state;
ctx->_TriangleCaps ^= DD_LINE_SMOOTH;
break;
case GL_LINE_STIPPLE:
- if (ctx->Line.StippleFlag == state)
+ if (ctx->Line.StippleFlag == state)
return;
FLUSH_VERTICES(ctx, _NEW_LINE);
ctx->Line.StippleFlag = state;
ctx->_TriangleCaps ^= DD_LINE_STIPPLE;
break;
case GL_INDEX_LOGIC_OP:
- if (ctx->Color.IndexLogicOpEnabled == state)
+ if (ctx->Color.IndexLogicOpEnabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.IndexLogicOpEnabled = state;
break;
case GL_COLOR_LOGIC_OP:
- if (ctx->Color.ColorLogicOpEnabled == state)
+ if (ctx->Color.ColorLogicOpEnabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.ColorLogicOpEnabled = state;
ctx->Pixel.MinMaxEnabled = state;
break;
case GL_NORMALIZE:
- if (ctx->Transform.Normalize == state)
+ if (ctx->Transform.Normalize == state)
return;
FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
ctx->Transform.Normalize = state;
ctx->_Enabled ^= ENABLE_NORMALIZE;
break;
case GL_POINT_SMOOTH:
- if (ctx->Point.SmoothFlag==state)
+ if (ctx->Point.SmoothFlag==state)
return;
FLUSH_VERTICES(ctx, _NEW_POINT);
ctx->Point.SmoothFlag = state;
ctx->_TriangleCaps ^= DD_POINT_SMOOTH;
break;
case GL_POLYGON_SMOOTH:
- if (ctx->Polygon.SmoothFlag==state)
+ if (ctx->Polygon.SmoothFlag==state)
return;
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.SmoothFlag = state;
ctx->_TriangleCaps ^= DD_TRI_SMOOTH;
break;
case GL_POLYGON_STIPPLE:
- if (ctx->Polygon.StippleFlag==state)
+ if (ctx->Polygon.StippleFlag==state)
return;
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.StippleFlag = state;
ctx->_TriangleCaps ^= DD_TRI_STIPPLE;
break;
case GL_POLYGON_OFFSET_POINT:
- if (ctx->Polygon.OffsetPoint==state)
+ if (ctx->Polygon.OffsetPoint==state)
return;
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.OffsetPoint = state;
break;
case GL_POLYGON_OFFSET_LINE:
- if (ctx->Polygon.OffsetLine==state)
+ if (ctx->Polygon.OffsetLine==state)
return;
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.OffsetLine = state;
break;
case GL_POLYGON_OFFSET_FILL:
/*case GL_POLYGON_OFFSET_EXT:*/
- if (ctx->Polygon.OffsetFill==state)
+ if (ctx->Polygon.OffsetFill==state)
return;
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.OffsetFill = state;
break;
case GL_RESCALE_NORMAL_EXT:
- if (ctx->Transform.RescaleNormals == state)
+ if (ctx->Transform.RescaleNormals == state)
return;
FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
ctx->Transform.RescaleNormals = state;
ctx->_Enabled ^= ENABLE_RESCALE;
break;
case GL_SCISSOR_TEST:
- if (ctx->Scissor.Enabled==state)
+ if (ctx->Scissor.Enabled==state)
return;
FLUSH_VERTICES(ctx, _NEW_SCISSOR);
ctx->Scissor.Enabled = state;
_mesa_warning(ctx, "glEnable(GL_STENCIL_TEST) but no stencil buffer");
return;
}
- if (ctx->Stencil.Enabled==state)
+ if (ctx->Stencil.Enabled==state)
return;
FLUSH_VERTICES(ctx, _NEW_STENCIL);
ctx->Stencil.Enabled = state;
const GLuint curr = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
GLuint newenabled = texUnit->Enabled & ~TEXTURE0_1D;
- if (state)
+ if (state)
newenabled |= TEXTURE0_1D;
if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
return;
const GLuint curr = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
GLuint newenabled = texUnit->Enabled & ~TEXTURE0_2D;
- if (state)
+ if (state)
newenabled |= TEXTURE0_2D;
if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
return;
const GLuint curr = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
GLuint newenabled = texUnit->Enabled & ~TEXTURE0_3D;
- if (state)
+ if (state)
newenabled |= TEXTURE0_3D;
if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texUnit->TexGenEnabled = newenabled;
break;
- }
+ }
break;
case GL_TEXTURE_GEN_S: {
GLuint unit = ctx->Texture.CurrentUnit;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texUnit->TexGenEnabled = newenabled;
break;
- }
+ }
break;
case GL_TEXTURE_GEN_T: {
GLuint unit = ctx->Texture.CurrentUnit;
case GL_NORMAL_ARRAY:
case GL_COLOR_ARRAY:
case GL_INDEX_ARRAY:
- case GL_TEXTURE_COORD_ARRAY:
+ case GL_TEXTURE_COORD_ARRAY:
case GL_EDGE_FLAG_ARRAY:
case GL_FOG_COORDINATE_ARRAY_EXT:
case GL_SECONDARY_COLOR_ARRAY_EXT:
const GLuint curr = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
GLuint newenabled = texUnit->Enabled & ~TEXTURE0_CUBE;
- if (state)
+ if (state)
newenabled |= TEXTURE0_CUBE;
if (!ctx->Extensions.ARB_texture_cube_map) {
_mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
ctx->Fog.ColorSumEnabled = state;
-
+
if ((ctx->Light.Enabled &&
ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
|| ctx->Fog.ColorSumEnabled)
- ctx->_TriangleCaps |= DD_SEPERATE_SPECULAR;
+ ctx->_TriangleCaps |= DD_SEPERATE_SPECULAR;
else
- ctx->_TriangleCaps &= ~DD_SEPERATE_SPECULAR;
+ ctx->_TriangleCaps &= ~DD_SEPERATE_SPECULAR;
break;
return GL_FALSE;
}
}
-
-
-
-
-
-
-
-/* $Id: enable.h,v 1.3 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: enable.h,v 1.4 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: enums.c,v 1.13 2001/03/07 05:06:11 brianp Exp $ */
+/* $Id: enums.c,v 1.14 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
+ *
* Author:
* Keith Whitwell <keithw@valinux.com>
*/
return f ? (*f)->c : "(unknown)";
}
-
-
-/* $Id: enums.h,v 1.2 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: enums.h,v 1.3 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/* $Id: eval.c,v 1.18 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: eval.c,v 1.19 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
GLint k;
GLfloat *pnts;
struct gl_1d_map *map = 0;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
assert(type == GL_FLOAT || type == GL_DOUBLE);
else
pnts = _mesa_copy_map_points2d(target, ustride, uorder,
vstride, vorder, (GLdouble*) points);
-
-
+
+
FLUSH_VERTICES(ctx, _NEW_EVAL);
map->Uorder = uorder;
map->u1 = u1;
{
_mesa_MapGrid2f( un, u1, u2, vn, v1, v2 );
}
-
-
-
-
-/* $Id: eval.h,v 1.5 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: eval.h,v 1.6 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: extensions.h,v 1.12 2001/02/26 23:58:12 brianp Exp $ */
+/* $Id: extensions.h,v 1.13 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
extern const char *_mesa_extensions_get_string( GLcontext *ctx );
#endif
-
-
-/* $Id: feedback.c,v 1.22 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: feedback.c,v 1.23 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer )
{
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
if (ctx->RenderMode==GL_FEEDBACK) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glFeedbackBuffer" );
}
if (!buffer) {
_mesa_error( ctx, GL_INVALID_VALUE, "glFeedbackBuffer(buffer==NULL)" );
- ctx->Feedback.BufferSize = 0;
+ ctx->Feedback.BufferSize = 0;
return;
}
ctx->Feedback._Mask = FB_3D;
break;
case GL_3D_COLOR:
- ctx->Feedback._Mask = (FB_3D |
+ ctx->Feedback._Mask = (FB_3D |
(ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX));
break;
case GL_3D_COLOR_TEXTURE:
- ctx->Feedback._Mask = (FB_3D |
- (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX) |
+ ctx->Feedback._Mask = (FB_3D |
+ (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX) |
FB_TEXTURE);
break;
case GL_4D_COLOR_TEXTURE:
- ctx->Feedback._Mask = (FB_3D | FB_4D |
+ ctx->Feedback._Mask = (FB_3D | FB_4D |
(ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX) |
FB_TEXTURE);
break;
}
ctx->RenderMode = mode;
- if (ctx->Driver.RenderMode)
+ if (ctx->Driver.RenderMode)
ctx->Driver.RenderMode( ctx, mode );
return result;
}
-
-/* $Id: feedback.h,v 1.6 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: feedback.h,v 1.7 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#endif
-
-/* $Id: fog.c,v 1.33 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: fog.c,v 1.34 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
ctx->Fog.Index = *params;
break;
case GL_FOG_COLOR:
- if (TEST_EQ_4V(ctx->Fog.Color, params))
+ if (TEST_EQ_4V(ctx->Fog.Color, params))
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
ctx->Fog.Color[0] = params[0];
(*ctx->Driver.Fogfv)( ctx, pname, params );
}
}
-
-
-/* $Id: fog.h,v 1.11 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: fog.h,v 1.12 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: get.c,v 1.55 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: get.c,v 1.56 2001/03/12 00:48:37 gareth Exp $ */
/*
* Mesa 3-D graphics library
case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
*params = ctx->Pixel.PostColorMatrixColorTableEnabled;
break;
-
+
/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
*params = ctx->Fog.ColorSumEnabled;
case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
*params = ctx->Array.LockCount;
break;
-
+
/* GL_ARB_transpose_matrix */
case GL_TRANSPOSE_COLOR_MATRIX_ARB:
{
ctx->ErrorValue = (GLenum) GL_NO_ERROR;
return e;
}
-
-/* $Id: get.h,v 1.4 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: get.h,v 1.5 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#endif
-
-/* $Id: glheader.h,v 1.17 2001/02/09 23:39:02 brianp Exp $ */
+/* $Id: glheader.h,v 1.18 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#if defined(__linux__) && defined(__i386__)
+#if defined(__linux__) && defined(__i386__)
#include <fpu_control.h>
#endif
#endif
-/* $Id: hash.c,v 1.9 2000/03/21 22:20:42 brianp Exp $ */
+/* $Id: hash.c,v 1.10 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/* $Id: hash.h,v 1.4 2000/03/21 22:20:42 brianp Exp $ */
+/* $Id: hash.h,v 1.5 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/* $Id: hint.c,v 1.8 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: hint.c,v 1.9 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
if (ctx->Driver.Hint) {
(*ctx->Driver.Hint)( ctx, target, mode );
}
-
+
return GL_TRUE;
}
-/* $Id: histogram.c,v 1.9 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: histogram.c,v 1.10 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
ctx->Histogram.AlphaSize = 8 * sizeof(GLuint);
ctx->Histogram.LuminanceSize = 8 * sizeof(GLuint);
}
-
+
ctx->NewState |= _NEW_PIXEL;
}
_mesa_error(ctx, GL_INVALID_ENUM, "glMinMax(internalFormat)");
return;
}
-
+
if (ctx->MinMax.Sink == sink)
return;
FLUSH_VERTICES(ctx, _NEW_PIXEL);
-/* $Id: histogram.h,v 1.2 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: histogram.h,v 1.3 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: imports.c,v 1.7 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: imports.c,v 1.8 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
/* Whacko XFree86 macro:
*/
#ifdef getenv
-#undef getenv
+#undef getenv
#endif
if (gc->imports.getenv(gc, "MESA_DEBUG")) {
debug = GL_TRUE;
-/* $Id: imports.h,v 1.1 2000/09/26 20:53:53 brianp Exp $ */
+/* $Id: imports.h,v 1.2 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: light.c,v 1.40 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: light.c,v 1.41 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
return;
}
- if (ctx->Light.ShadeModel == mode)
+ if (ctx->Light.ShadeModel == mode)
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
_mesa_error( ctx, GL_INVALID_VALUE, "glLight" );
return;
}
- if (l->SpotExponent == params[0])
+ if (l->SpotExponent == params[0])
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
l->SpotExponent = params[0];
ctx->Light.Model.TwoSide = newbool;
break;
case GL_LIGHT_MODEL_COLOR_CONTROL:
- if (params[0] == (GLfloat) GL_SINGLE_COLOR)
+ if (params[0] == (GLfloat) GL_SINGLE_COLOR)
newenum = GL_SINGLE_COLOR;
- else if (params[0] == (GLfloat) GL_SEPARATE_SPECULAR_COLOR)
+ else if (params[0] == (GLfloat) GL_SEPARATE_SPECULAR_COLOR)
newenum = GL_SEPARATE_SPECULAR_COLOR;
else {
_mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(param)" );
if ((ctx->Light.Enabled &&
ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
|| ctx->Fog.ColorSumEnabled)
- ctx->_TriangleCaps |= DD_SEPERATE_SPECULAR;
+ ctx->_TriangleCaps |= DD_SEPERATE_SPECULAR;
else
- ctx->_TriangleCaps &= ~DD_SEPERATE_SPECULAR;
+ ctx->_TriangleCaps &= ~DD_SEPERATE_SPECULAR;
break;
default:
*
* src[0] is front material, src[1] is back material
*
- * Additionally keeps the precomputed lighting state uptodate.
+ * Additionally keeps the precomputed lighting state uptodate.
*/
void _mesa_update_material( GLcontext *ctx,
const struct gl_material src[2],
if (bitmask & (FRONT_EMISSION_BIT | FRONT_AMBIENT_BIT)) {
struct gl_material *mat = &ctx->Light.Material[0];
COPY_3V( ctx->Light._BaseColor[0], mat->Emission );
- ACC_SCALE_3V( ctx->Light._BaseColor[0], mat->Ambient,
+ ACC_SCALE_3V( ctx->Light._BaseColor[0], mat->Ambient,
ctx->Light.Model.Ambient );
}
if (bitmask & (BACK_EMISSION_BIT | BACK_AMBIENT_BIT)) {
struct gl_material *mat = &ctx->Light.Material[1];
COPY_3V( ctx->Light._BaseColor[1], mat->Emission );
- ACC_SCALE_3V( ctx->Light._BaseColor[1], mat->Ambient,
+ ACC_SCALE_3V( ctx->Light._BaseColor[1], mat->Ambient,
ctx->Light.Model.Ambient );
}
l->_SpotExpTable[i][0] = tmp;
}
for (i = 0; i < EXP_TABLE_SIZE - 1; i++) {
- l->_SpotExpTable[i][1] = (l->_SpotExpTable[i+1][0] -
+ l->_SpotExpTable[i][1] = (l->_SpotExpTable[i+1][0] -
l->_SpotExpTable[i][0]);
}
l->_SpotExpTable[EXP_TABLE_SIZE-1][1] = 0.0;
void
_mesa_invalidate_shine_table( GLcontext *ctx, GLuint i )
{
- if (ctx->_ShineTable[i])
+ if (ctx->_ShineTable[i])
ctx->_ShineTable[i]->refcount--;
ctx->_ShineTable[i] = 0;
}
s->shininess = shininess;
}
- if (ctx->_ShineTable[i])
+ if (ctx->_ShineTable[i])
ctx->_ShineTable[i]->refcount--;
ctx->_ShineTable[i] = s;
s->refcount++;
}
-void
+void
_mesa_validate_all_lighting_tables( GLcontext *ctx )
{
GLint i;
if (!ctx->_ShineTable[1] || ctx->_ShineTable[1]->shininess != shininess)
validate_shine_table( ctx, 1, shininess );
- for (i = 0 ; i < MAX_LIGHTS ; i++)
+ for (i = 0 ; i < MAX_LIGHTS ; i++)
if (ctx->Light.Light[i]._SpotExpTable[0][0] == -1)
validate_spot_exp_table( &ctx->Light.Light[i] );
}
/* Precompute some shading values. Although we reference
* Light.Material here, we can get away without flushing
* FLUSH_UPDATE_CURRENT, as when any outstanding material changes
- * are flushed, they will update the derived state at that time.
+ * are flushed, they will update the derived state at that time.
*/
if (ctx->Visual.rgbMode) {
GLuint sides = ctx->Light.Model.TwoSide ? 2 : 1;
ctx->Light.Material[side].Diffuse[3] );
}
- foreach (light, &ctx->Light.EnabledList) {
+ foreach (light, &ctx->Light.EnabledList) {
for (side=0; side< sides; side++) {
const struct gl_material *mat = &ctx->Light.Material[side];
SCALE_3V( light->_MatDiffuse[side], light->Diffuse, mat->Diffuse );
}
}
}
-
-
-/* $Id: light.h,v 1.11 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: light.h,v 1.12 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#endif
-
-/* $Id: lines.c,v 1.28 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: lines.c,v 1.29 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
return;
}
- if (ctx->Line.Width == width)
+ if (ctx->Line.Width == width)
return;
FLUSH_VERTICES(ctx, _NEW_LINE);
ctx->Line.Width = width;
- ctx->Line._Width = CLAMP(width,
+ ctx->Line._Width = CLAMP(width,
ctx->Const.MinLineWidth,
ctx->Const.MaxLineWidth);
- if (width != 1.0)
+ if (width != 1.0)
ctx->_TriangleCaps |= DD_LINE_WIDTH;
else
ctx->_TriangleCaps &= ~DD_LINE_WIDTH;
if (ctx->Driver.LineStipple)
ctx->Driver.LineStipple( ctx, factor, pattern );
}
-
-
-/* $Id: lines.h,v 1.4 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: lines.h,v 1.5 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: macros.h,v 1.18 2001/01/24 00:04:58 brianp Exp $ */
+/* $Id: macros.h,v 1.19 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
#define TEST_BITS(WORD, BITS) ((WORD) & (BITS))
-/* Stepping a GLfloat pointer by a byte stride
+/* Stepping a GLfloat pointer by a byte stride
*/
#define STRIDE_F(p, i) (p = (GLfloat *)((GLubyte *)p + i))
#define STRIDE_UI(p, i) (p = (GLuint *)((GLubyte *)p + i))
(a)[2] == (b)[2])
#if defined(__i386__)
-#define TEST_EQ_4UBV(DST, SRC) *((GLuint*)(DST)) == *((GLuint*)(SRC))
+#define TEST_EQ_4UBV(DST, SRC) *((GLuint*)(DST)) == *((GLuint*)(SRC))
#else
#define TEST_EQ_4UBV(DST, SRC) TEST_EQ_4V(DST, SRC)
#endif
case 2: (DST)[1] = (SRC)[1]; \
case 1: (DST)[0] = (SRC)[0]; \
} \
-} while(0)
+} while(0)
#define COPY_CLEAN_4V(DST, SZ, SRC) \
do { \
-/* $Id: matrix.h,v 1.11 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: matrix.h,v 1.12 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: pixel.c,v 1.26 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: pixel.c,v 1.27 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
switch (pname) {
case GL_PACK_SWAP_BYTES:
- if (param == (GLint)ctx->Pack.SwapBytes)
+ if (param == (GLint)ctx->Pack.SwapBytes)
return;
FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
ctx->Pack.SwapBytes = param ? GL_TRUE : GL_FALSE;
break;
case GL_PACK_LSB_FIRST:
- if (param == (GLint)ctx->Pack.LsbFirst)
+ if (param == (GLint)ctx->Pack.LsbFirst)
return;
FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
ctx->Pack.LsbFirst = param ? GL_TRUE : GL_FALSE;
ctx->Pack.Alignment = param;
break;
case GL_UNPACK_SWAP_BYTES:
- if (param == (GLint)ctx->Unpack.SwapBytes)
+ if (param == (GLint)ctx->Unpack.SwapBytes)
return;
if ((GLint)ctx->Unpack.SwapBytes == param)
return;
ctx->Unpack.SwapBytes = param ? GL_TRUE : GL_FALSE;
break;
case GL_UNPACK_LSB_FIRST:
- if (param == (GLint)ctx->Unpack.LsbFirst)
+ if (param == (GLint)ctx->Unpack.LsbFirst)
return;
if ((GLint)ctx->Unpack.LsbFirst == param)
return;
-/* $Id: pixel.h,v 1.9 2000/12/13 00:46:21 brianp Exp $ */
+/* $Id: pixel.h,v 1.10 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: points.c,v 1.29 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: points.c,v 1.30 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.4
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
return;
}
- if (ctx->Point.Size == size)
+ if (ctx->Point.Size == size)
return;
FLUSH_VERTICES(ctx, _NEW_POINT);
ctx->Point.Size = size;
- ctx->Point._Size = CLAMP(size,
+ ctx->Point._Size = CLAMP(size,
ctx->Const.MinPointSize,
ctx->Const.MaxPointSize);
if (ctx->Driver.PointParameterfv)
(*ctx->Driver.PointParameterfv)(ctx, pname, params);
}
-
-/* $Id: points.h,v 1.4 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: points.h,v 1.5 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: polygon.c,v 1.19 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: polygon.c,v 1.20 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
}
ctx->_TriangleCaps &= ~DD_TRI_UNFILLED;
- if (ctx->Polygon.FrontMode!=GL_FILL || ctx->Polygon.BackMode!=GL_FILL)
+ if (ctx->Polygon.FrontMode!=GL_FILL || ctx->Polygon.BackMode!=GL_FILL)
ctx->_TriangleCaps |= DD_TRI_UNFILLED;
if (ctx->Driver.PolygonMode) {
-/* $Id: polygon.h,v 1.3 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: polygon.h,v 1.4 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#endif
-
-/* $Id: rastpos.c,v 1.21 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: rastpos.c,v 1.22 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
}
else {
GLfloat d;
-
+
SUB_3V(VP, light->_Position, vertex);
d = LEN_3FV( VP );
-
+
if ( d > 1e-6) {
GLfloat invd = 1.0F / d;
SELF_SCALE_SCALAR_3V(VP, invd);
attenuation = 1.0F / (light->ConstantAttenuation + d *
(light->LinearAttenuation + d *
light->QuadraticAttenuation));
-
+
if (light->_Flags & LIGHT_SPOT) {
GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection);
-
+
if (PV_dot_dir<light->_CosCutoff) {
continue;
}
h = light->_h_inf_norm;
normalized = 1;
}
-
+
n_dot_h = DOT3(normal, h);
if (n_dot_h > 0.0F) {
n_dot_h /= LEN_SQUARED_3FV( h );
shininess *= .5;
}
-
+
GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec_coef );
if (spec_coef > 1.0e-10) {
-/* $Id: rastpos.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */
+/* $Id: rastpos.h,v 1.3 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
#endif
-
-/* $Id: simple_list.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: simple_list.h,v 1.2 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* (C) 1997, Keith Whitwell
*
* Intended to work with a list sentinal which is created as an empty
- * list. Insert & delete are O(1).
+ * list. Insert & delete are O(1).
*/
#endif
-
-/* $Id: state.c,v 1.60 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: state.c,v 1.61 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
GLuint new_state = ctx->NewState;
/* Recalculate that same state only if it has been invalidated
- * by other statechanges.
+ * by other statechanges.
*/
if (new_state & _NEW_MODELVIEW)
update_modelview_scale(ctx);
if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
calculate_model_project_matrix(ctx);
-
+
if (new_state & (_NEW_LIGHT|_NEW_MODELVIEW))
_mesa_compute_light_positions( ctx );
}
update_projection( GLcontext *ctx )
{
_math_matrix_analyse( &ctx->ProjectionMatrix );
-
+
/* Recompute clip plane positions in clipspace. This is also done
* in _mesa_ClipPlane().
*/
* state references this value, and must be treated with care to
* ensure that updates are done correctly. All state dependent on
* _NeedEyeCoords is calculated from within _mesa_update_tnl_spaces(),
- * and from nowhere else.
+ * and from nowhere else.
*/
void _mesa_update_state( GLcontext *ctx )
{
* normal transform.
*
* If the lighting space hasn't changed, may still need to recompute
- * light positions & normal transforms for other reasons.
+ * light positions & normal transforms for other reasons.
*/
if (new_state & (_NEW_MODELVIEW |
_NEW_PROJECTION |
ctx->Array.NewState = 0;
/* At this point we can do some assertions to be sure the required
- * device driver function pointers are all initialized.
+ * device driver function pointers are all initialized.
*
* KW: Moved the some of these asserts to t_vb_render.c, as they
* are strictly only required for that stage. The Driver struct
* should probably be split; the read/write span/pixels functions
- * should be referenced only from swrast, for instance.
+ * should be referenced only from swrast, for instance.
*/
ASSERT(ctx->Driver.GetString);
ASSERT(ctx->Driver.UpdateState);
-/* $Id: state.h,v 1.6 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: state.h,v 1.7 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: stencil.c,v 1.25 2001/03/03 20:33:28 brianp Exp $ */
+/* $Id: stencil.c,v 1.26 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
-
+
if (ctx->Stencil.Clear == (GLstencil) s)
return;
(*ctx->Driver.StencilOp)(ctx, fail, zfail, zpass);
}
}
-
-/* $Id: stencil.h,v 1.8 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: stencil.h,v 1.9 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: teximage.c,v 1.83 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: teximage.c,v 1.84 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: teximage.h,v 1.16 2001/02/06 21:42:48 brianp Exp $ */
+/* $Id: teximage.h,v 1.17 2001/03/12 00:48:38 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#endif
-
-/* $Id: texobj.c,v 1.43 2001/03/08 15:23:46 brianp Exp $ */
+/* $Id: texobj.c,v 1.44 2001/03/12 00:48:39 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* Return: pointer to new texture object
*/
struct gl_texture_object *
-_mesa_alloc_texture_object( struct gl_shared_state *shared,
+_mesa_alloc_texture_object( struct gl_shared_state *shared,
GLuint name, GLuint dimensions )
{
struct gl_texture_object *obj;
newTexObj->RefCount++;
-
+
/* do the actual binding, but first flush outstanding vertices:
*/
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
return texture > 0 && _mesa_HashLookup(ctx->Shared->TexObjects, texture);
}
-
-/* $Id: texobj.h,v 1.5 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: texobj.h,v 1.6 2001/03/12 00:48:39 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: texstate.h,v 1.6 2001/02/06 21:42:48 brianp Exp $ */
+/* $Id: texstate.h,v 1.7 2001/03/12 00:48:39 gareth Exp $ */
/*
* Mesa 3-D graphics library
#endif
-
-/* $Id: texstore.c,v 1.10 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: texstore.c,v 1.11 2001/03/12 00:48:39 gareth Exp $ */
/*
* Mesa 3-D graphics library
return GL_TRUE;
}
-
-/* $Id: texutil.c,v 1.13 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: texutil.c,v 1.14 2001/03/12 00:48:39 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.4
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: texutil.h,v 1.7 2001/01/24 00:04:58 brianp Exp $ */
+/* $Id: texutil.h,v 1.8 2001/03/12 00:48:39 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#endif
-
-/* $Id: varray.c,v 1.38 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: varray.c,v 1.39 2001/03/12 00:48:39 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
count <= (GLint) ctx->Const.MaxArrayLockSize) {
ctx->Array.LockFirst = first;
ctx->Array.LockCount = count;
- }
+ }
else {
ctx->Array.LockFirst = 0;
ctx->Array.LockCount = 0;
-/* $Id: varray.h,v 1.11 2000/11/24 10:25:06 keithw Exp $ */
+/* $Id: varray.h,v 1.12 2001/03/12 00:48:39 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: vtxfmt.c,v 1.4 2001/03/11 23:55:19 gareth Exp $ */
+/* $Id: vtxfmt.c,v 1.5 2001/03/12 00:48:39 gareth Exp $ */
/*
* Mesa 3-D graphics library
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
* Gareth Hughes <gareth@valinux.com>
*/
install_vtxfmt( ctx->Exec, &neutral_vtxfmt );
}
+
void _mesa_install_exec_vtxfmt( GLcontext *ctx, GLvertexformat *vfmt )
{
ctx->TnlModule.Current = vfmt;
_mesa_loopback_prefer_float( ctx->Save, vfmt->prefer_float_colors );
}
+
void _mesa_restore_exec_vtxfmt( GLcontext *ctx )
{
struct gl_tnl_module *tnl = &(ctx->TnlModule);
-/* $Id: vtxfmt.h,v 1.3 2001/03/11 23:49:20 gareth Exp $ */
+/* $Id: vtxfmt.h,v 1.4 2001/03/12 00:48:39 gareth Exp $ */
/*
* Mesa 3-D graphics library
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
* Gareth Hughes <gareth@valinux.com>
*/
-/* $Id: vtxfmt_tmp.h,v 1.3 2001/03/11 18:49:11 gareth Exp $ */
+/* $Id: vtxfmt_tmp.h,v 1.4 2001/03/12 00:48:39 gareth Exp $ */
/*
* Mesa 3-D graphics library
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Gareth Hughes <gareth@valinux.com>
*/
-/* $Id: m_clip_tmp.h,v 1.5 2001/03/03 20:57:00 brianp Exp $ */
+/* $Id: m_clip_tmp.h,v 1.6 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* the case where the cliptest passes. This isn't essential,
* and an asm implementation needn't replicate that behaviour.
*/
-static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec,
- GLvector4f *proj_vec,
+static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec,
+ GLvector4f *proj_vec,
GLubyte clipMask[],
- GLubyte *orMask,
+ GLubyte *orMask,
GLubyte *andMask )
{
const GLuint stride = clip_vec->stride;
vProj[i][2] = 0;
vProj[i][3] = 1;
} else {
- GLfloat oow = 1.0F / cw;
+ GLfloat oow = 1.0F / cw;
vProj[i][0] = cx * oow;
vProj[i][1] = cy * oow;
- vProj[i][2] = cz * oow;
+ vProj[i][2] = cz * oow;
vProj[i][3] = oow;
- }
+ }
}
*orMask = tmpOrMask;
-static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec,
- GLvector4f *proj_vec,
+static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec,
+ GLvector4f *proj_vec,
GLubyte clipMask[],
- GLubyte *orMask,
+ GLubyte *orMask,
GLubyte *andMask )
{
const GLuint stride = clip_vec->stride;
c++;
tmpAndMask &= mask;
tmpOrMask |= mask;
- }
+ }
}
*orMask = tmpOrMask;
}
-static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec,
- GLvector4f *proj_vec,
+static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec,
+ GLvector4f *proj_vec,
GLubyte clipMask[],
- GLubyte *orMask,
+ GLubyte *orMask,
GLubyte *andMask )
{
const GLuint stride = clip_vec->stride;
}
-static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec,
- GLvector4f *proj_vec,
+static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec,
+ GLvector4f *proj_vec,
GLubyte clipMask[],
- GLubyte *orMask,
+ GLubyte *orMask,
GLubyte *andMask )
{
const GLuint stride = clip_vec->stride;
-/* $Id: m_copy_tmp.h,v 1.3 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: m_copy_tmp.h,v 1.4 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: m_debug.h,v 1.2 2001/02/05 19:17:31 brianp Exp $ */
+/* $Id: m_debug.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Gareth Hughes <gareth@valinux.com>
*/
-/* $Id: m_debug_norm.c,v 1.4 2001/03/08 15:23:46 brianp Exp $ */
+/* $Id: m_debug_norm.c,v 1.5 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Gareth Hughes <gareth@valinux.com>
*/
-/* $Id: m_debug_util.h,v 1.1 2001/02/03 08:41:04 gareth Exp $ */
+/* $Id: m_debug_util.h,v 1.2 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Gareth Hughes <gareth@valinux.com>
*/
-/* $Id: m_debug_xform.c,v 1.4 2001/03/08 15:23:46 brianp Exp $ */
+/* $Id: m_debug_xform.c,v 1.5 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: m_dotprod_tmp.h,v 1.3 2001/03/03 20:57:00 brianp Exp $ */
+/* $Id: m_dotprod_tmp.h,v 1.4 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
/* Note - respects the stride of the output vector.
*/
-static void TAG(dotprod_vec2)( GLfloat *out,
+static void TAG(dotprod_vec2)( GLfloat *out,
GLuint outstride,
- const GLvector4f *coord_vec,
- const GLfloat plane[4],
+ const GLvector4f *coord_vec,
+ const GLfloat plane[4],
const GLubyte mask[])
{
GLuint stride = coord_vec->stride;
GLuint count = coord_vec->count;
GLuint i;
-
+
const GLfloat plane0 = plane[0], plane1 = plane[1], plane3 = plane[3];
-
+
(void) mask;
for (i=0;i<count;i++,STRIDE_F(coord,stride),STRIDE_F(out,outstride)) {
coord[1] * plane1 +
plane3);
}
- }
+ }
}
-static void TAG(dotprod_vec3)( GLfloat *out,
+static void TAG(dotprod_vec3)( GLfloat *out,
GLuint outstride,
- const GLvector4f *coord_vec,
- const GLfloat plane[4],
+ const GLvector4f *coord_vec,
+ const GLfloat plane[4],
const GLubyte mask[])
{
GLuint stride = coord_vec->stride;
coord[2] * plane2 +
plane3);
}
- }
+ }
}
-static void TAG(dotprod_vec4)( GLfloat *out,
+static void TAG(dotprod_vec4)( GLfloat *out,
GLuint outstride,
- const GLvector4f *coord_vec,
- const GLfloat plane[4],
+ const GLvector4f *coord_vec,
+ const GLfloat plane[4],
const GLubyte mask[])
{
GLuint stride = coord_vec->stride;
coord[2] * plane2 +
coord[3] * plane3);
}
- }
+ }
}
-/* $Id: m_eval.c,v 1.4 2001/03/08 17:17:28 brianp Exp $ */
+/* $Id: m_eval.c,v 1.5 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
+/* $Id: m_eval.h,v 1.2 2001/03/12 00:48:41 gareth Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
#ifndef _M_EVAL_H
#define _M_EVAL_H
-/* $Id: m_matrix.c,v 1.7 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: m_matrix.c,v 1.8 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
/*
- * This matmul was contributed by Thomas Malik
+ * This matmul was contributed by Thomas Malik
*
* Perform a 4x4 matrix multiplication (product = a x b).
* Input: a, b - matrices to multiply
* Output: product - product of a and b
* WARNING: (product != b) assumed
- * NOTE: (product == a) allowed
+ * NOTE: (product == a) allowed
*
* KW: 4*16 = 64 muls
*/
/* Multiply two matrices known to occupy only the top three rows, such
- * as typical model matrices, and ortho matrices.
+ * as typical model matrices, and ortho matrices.
*/
static void matmul34( GLfloat *product, const GLfloat *a, const GLfloat *b )
{
if (TEST_MAT_FLAGS(mat, MAT_FLAGS_3D))
matmul34( mat->m, mat->m, m );
- else
- matmul4( mat->m, mat->m, m );
+ else
+ matmul4( mat->m, mat->m, m );
}
}
}
-void
+void
_math_matrix_print( const GLmatrix *m )
{
fprintf(stderr, "Matrix type: %s, flags: %x\n", types[m->type], m->flags);
GLfloat wtmp[4][8];
GLfloat m0, m1, m2, m3, s;
GLfloat *r0, *r1, *r2, *r3;
-
+
r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3];
-
+
r0[0] = MAT(m,0,0), r0[1] = MAT(m,0,1),
r0[2] = MAT(m,0,2), r0[3] = MAT(m,0,3),
r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0,
-
+
r1[0] = MAT(m,1,0), r1[1] = MAT(m,1,1),
r1[2] = MAT(m,1,2), r1[3] = MAT(m,1,3),
r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0,
-
+
r2[0] = MAT(m,2,0), r2[1] = MAT(m,2,1),
r2[2] = MAT(m,2,2), r2[3] = MAT(m,2,3),
r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0,
-
+
r3[0] = MAT(m,3,0), r3[1] = MAT(m,3,1),
r3[2] = MAT(m,3,2), r3[3] = MAT(m,3,3),
r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0;
-
+
/* choose pivot - or die */
if (fabs(r3[0])>fabs(r2[0])) SWAP_ROWS(r3, r2);
if (fabs(r2[0])>fabs(r1[0])) SWAP_ROWS(r2, r1);
if (fabs(r1[0])>fabs(r0[0])) SWAP_ROWS(r1, r0);
if (0.0 == r0[0]) return GL_FALSE;
-
+
/* eliminate first variable */
m1 = r1[0]/r0[0]; m2 = r2[0]/r0[0]; m3 = r3[0]/r0[0];
s = r0[1]; r1[1] -= m1 * s; r2[1] -= m2 * s; r3[1] -= m3 * s;
if (s != 0.0) { r1[6] -= m1 * s; r2[6] -= m2 * s; r3[6] -= m3 * s; }
s = r0[7];
if (s != 0.0) { r1[7] -= m1 * s; r2[7] -= m2 * s; r3[7] -= m3 * s; }
-
+
/* choose pivot - or die */
if (fabs(r3[1])>fabs(r2[1])) SWAP_ROWS(r3, r2);
if (fabs(r2[1])>fabs(r1[1])) SWAP_ROWS(r2, r1);
if (0.0 == r1[1]) return GL_FALSE;
-
+
/* eliminate second variable */
m2 = r2[1]/r1[1]; m3 = r3[1]/r1[1];
r2[2] -= m2 * r1[2]; r3[2] -= m3 * r1[2];
s = r1[5]; if (0.0 != s) { r2[5] -= m2 * s; r3[5] -= m3 * s; }
s = r1[6]; if (0.0 != s) { r2[6] -= m2 * s; r3[6] -= m3 * s; }
s = r1[7]; if (0.0 != s) { r2[7] -= m2 * s; r3[7] -= m3 * s; }
-
+
/* choose pivot - or die */
if (fabs(r3[2])>fabs(r2[2])) SWAP_ROWS(r3, r2);
if (0.0 == r2[2]) return GL_FALSE;
-
+
/* eliminate third variable */
m3 = r3[2]/r2[2];
r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4],
r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6],
r3[7] -= m3 * r2[7];
-
+
/* last check */
if (0.0 == r3[3]) return GL_FALSE;
-
+
s = 1.0/r3[3]; /* now back substitute row 3 */
r3[4] *= s; r3[5] *= s; r3[6] *= s; r3[7] *= s;
-
+
m2 = r2[3]; /* now back substitute row 2 */
s = 1.0/r2[2];
r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2),
m0 = r0[3];
r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0,
r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0;
-
+
m1 = r1[2]; /* now back substitute row 1 */
s = 1.0/r1[1];
r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1),
m0 = r0[2];
r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0,
r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0;
-
+
m0 = r0[1]; /* now back substitute row 0 */
s = 1.0/r0[0];
r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0),
r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0);
-
+
MAT(out,0,0) = r0[4]; MAT(out,0,1) = r0[5],
MAT(out,0,2) = r0[6]; MAT(out,0,3) = r0[7],
MAT(out,1,0) = r1[4]; MAT(out,1,1) = r1[5],
MAT(out,2,0) = r2[4]; MAT(out,2,1) = r2[5],
MAT(out,2,2) = r2[6]; MAT(out,2,3) = r2[7],
MAT(out,3,0) = r3[4]; MAT(out,3,1) = r3[5],
- MAT(out,3,2) = r3[6]; MAT(out,3,3) = r3[7];
-
+ MAT(out,3,2) = r3[6]; MAT(out,3,3) = r3[7];
+
return GL_TRUE;
}
#undef SWAP_ROWS
/* Adapted from graphics gems II.
- */
+ */
static GLboolean invert_matrix_3d_general( GLmatrix *mat )
{
const GLfloat *in = mat->m;
GLfloat det;
/* Calculate the determinant of upper left 3x3 submatrix and
- * determine if the matrix is singular.
+ * determine if the matrix is singular.
*/
pos = neg = 0.0;
t = MAT(in,0,0) * MAT(in,1,1) * MAT(in,2,2);
det = pos + neg;
- if (det*det < 1e-25)
+ if (det*det < 1e-25)
return GL_FALSE;
-
+
det = 1.0 / det;
MAT(out,0,0) = ( (MAT(in,1,1)*MAT(in,2,2) - MAT(in,2,1)*MAT(in,1,2) )*det);
MAT(out,0,1) = (- (MAT(in,0,1)*MAT(in,2,2) - MAT(in,2,1)*MAT(in,0,2) )*det);
MAT(out,2,3) = - (MAT(in,0,3) * MAT(out,2,0) +
MAT(in,1,3) * MAT(out,2,1) +
MAT(in,2,3) * MAT(out,2,2) );
-
+
return GL_TRUE;
}
if (!TEST_MAT_FLAGS(mat, MAT_FLAGS_ANGLE_PRESERVING)) {
return invert_matrix_3d_general( mat );
}
-
+
if (mat->flags & MAT_FLAG_UNIFORM_SCALE) {
GLfloat scale = (MAT(in,0,0) * MAT(in,0,0) +
MAT(in,0,1) * MAT(in,0,1) +
MAT(in,0,2) * MAT(in,0,2));
- if (scale == 0.0)
+ if (scale == 0.0)
return GL_FALSE;
scale = 1.0 / scale;
MAT(out,2,3) = - MAT(in,2,3);
return GL_TRUE;
}
-
+
if (mat->flags & MAT_FLAG_TRANSLATION) {
/* Do the translation part */
MAT(out,0,3) = - (MAT(in,0,3) * MAT(out,0,0) +
else {
MAT(out,0,3) = MAT(out,1,3) = MAT(out,2,3) = 0.0;
}
-
+
return GL_TRUE;
}
-
+
static GLboolean invert_matrix_identity( GLmatrix *mat )
{
const GLfloat *in = mat->m;
GLfloat *out = mat->inv;
- if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0 || MAT(in,2,2) == 0 )
+ if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0 || MAT(in,2,2) == 0 )
return GL_FALSE;
-
+
MEMCPY( out, Identity, 16 * sizeof(GLfloat) );
MAT(out,0,0) = 1.0 / MAT(in,0,0);
MAT(out,1,1) = 1.0 / MAT(in,1,1);
const GLfloat *in = mat->m;
GLfloat *out = mat->inv;
- if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0)
+ if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0)
return GL_FALSE;
-
+
MEMCPY( out, Identity, 16 * sizeof(GLfloat) );
MAT(out,0,0) = 1.0 / MAT(in,0,0);
MAT(out,1,1) = 1.0 / MAT(in,1,1);
mat->flags |= MAT_FLAG_SINGULAR;
MEMCPY( mat->inv, Identity, sizeof(Identity) );
return GL_FALSE;
- }
+ }
}
* Generate a 4x4 transformation matrix from glRotate parameters, and
* postmultiply the input matrix by it.
*/
-void
-_math_matrix_rotate( GLmatrix *mat,
+void
+_math_matrix_rotate( GLmatrix *mat,
GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
{
/* This function contributed by Erich Boleyn (erich@uruk.org) */
GLfloat mag, s, c;
GLfloat xx, yy, zz, xy, yz, zx, xs, ys, zs, one_c;
GLfloat m[16];
-
+
s = sin( angle * DEG2RAD );
c = cos( angle * DEG2RAD );
void
-_math_matrix_frustum( GLmatrix *mat,
+_math_matrix_frustum( GLmatrix *mat,
GLfloat left, GLfloat right,
- GLfloat bottom, GLfloat top,
+ GLfloat bottom, GLfloat top,
GLfloat nearval, GLfloat farval )
{
GLfloat x, y, a, b, c, d;
}
void
-_math_matrix_ortho( GLmatrix *mat,
+_math_matrix_ortho( GLmatrix *mat,
GLfloat left, GLfloat right,
- GLfloat bottom, GLfloat top,
+ GLfloat bottom, GLfloat top,
GLfloat nearval, GLfloat farval )
{
GLfloat x, y, z;
ZERO(3) | ZERO(7) | ZERO(15) )
#define SQ(x) ((x)*(x))
-
+
/* Determine type and flags from scratch. This is expensive enough to
* only want to do it once.
*/
for (i = 0 ; i < 16 ; i++) {
if (m[i] == 0.0) mask |= (1<<i);
}
-
+
if (m[0] == 1.0F) mask |= (1<<16);
if (m[5] == 1.0F) mask |= (1<<21);
if (m[10] == 1.0F) mask |= (1<<26);
mat->flags &= ~MAT_FLAGS_GEOMETRY;
- /* Check for translation - no-one really cares
+ /* Check for translation - no-one really cares
*/
- if ((mask & MASK_NO_TRX) != MASK_NO_TRX)
- mat->flags |= MAT_FLAG_TRANSLATION;
+ if ((mask & MASK_NO_TRX) != MASK_NO_TRX)
+ mat->flags |= MAT_FLAG_TRANSLATION;
/* Do the real work
*/
}
else if ((mask & MASK_2D_NO_ROT) == (GLuint) MASK_2D_NO_ROT) {
mat->type = MATRIX_2D_NO_ROT;
-
+
if ((mask & MASK_NO_2D_SCALE) != MASK_NO_2D_SCALE)
mat->flags = MAT_FLAG_GENERAL_SCALE;
}
/* Check for scale */
if (SQ(mm-1) > SQ(1e-6) ||
- SQ(m4m4-1) > SQ(1e-6))
+ SQ(m4m4-1) > SQ(1e-6))
mat->flags |= MAT_FLAG_GENERAL_SCALE;
/* Check for rotation */
mat->type = MATRIX_3D_NO_ROT;
/* Check for scale */
- if (SQ(m[0]-m[5]) < SQ(1e-6) &&
+ if (SQ(m[0]-m[5]) < SQ(1e-6) &&
SQ(m[0]-m[10]) < SQ(1e-6)) {
if (SQ(m[0]-1.0) > SQ(1e-6)) {
mat->flags |= MAT_FLAG_UNIFORM_SCALE;
if (SQ(d1) < SQ(1e-6)) {
CROSS3( cp, m, m+4 );
SUB_3V( cp, cp, (m+8) );
- if (LEN_SQUARED_3FV(cp) < SQ(1e-6))
+ if (LEN_SQUARED_3FV(cp) < SQ(1e-6))
mat->flags |= MAT_FLAG_ROTATION;
else
mat->flags |= MAT_FLAG_GENERAL_3D;
/* Analyse a matrix given that its flags are accurate - this is the
- * more common operation, hopefully.
+ * more common operation, hopefully.
*/
static void analyse_from_flags( GLmatrix *mat )
{
}
}
else if (TEST_MAT_FLAGS(mat, MAT_FLAGS_3D)) {
- if ( m[ 8]==0.0F
+ if ( m[ 8]==0.0F
&& m[ 9]==0.0F
&& m[2]==0.0F && m[6]==0.0F && m[10]==1.0F && m[14]==0.0F) {
mat->type = MATRIX_2D;
}
-void
-_math_matrix_analyse( GLmatrix *mat )
+void
+_math_matrix_analyse( GLmatrix *mat )
{
if (mat->flags & MAT_DIRTY_TYPE) {
- if (mat->flags & MAT_DIRTY_FLAGS)
+ if (mat->flags & MAT_DIRTY_FLAGS)
analyse_from_scratch( mat );
else
analyse_from_flags( mat );
}
-void
+void
_math_matrix_copy( GLmatrix *to, const GLmatrix *from )
{
MEMCPY( to->m, from->m, sizeof(Identity) );
}
-void
+void
_math_matrix_scale( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z )
{
GLfloat *m = mat->m;
else
mat->flags |= MAT_FLAG_GENERAL_SCALE;
- mat->flags |= (MAT_DIRTY_TYPE |
+ mat->flags |= (MAT_DIRTY_TYPE |
MAT_DIRTY_INVERSE);
}
-void
+void
_math_matrix_translate( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z )
{
GLfloat *m = mat->m;
m[14] = m[2] * x + m[6] * y + m[10] * z + m[14];
m[15] = m[3] * x + m[7] * y + m[11] * z + m[15];
- mat->flags |= (MAT_FLAG_TRANSLATION |
- MAT_DIRTY_TYPE |
+ mat->flags |= (MAT_FLAG_TRANSLATION |
+ MAT_DIRTY_TYPE |
MAT_DIRTY_INVERSE);
}
-void
+void
_math_matrix_loadf( GLmatrix *mat, const GLfloat *m )
{
MEMCPY( mat->m, m, 16*sizeof(GLfloat) );
mat->flags = (MAT_FLAG_GENERAL | MAT_DIRTY);
}
-void
+void
_math_matrix_ctr( GLmatrix *m )
{
if ( m->m == 0 ) {
m->flags = 0;
}
-void
+void
_math_matrix_dtr( GLmatrix *m )
{
if ( m->m != 0 ) {
}
-void
+void
_math_matrix_alloc_inv( GLmatrix *m )
{
if ( m->inv == 0 ) {
}
-void
+void
_math_matrix_mul_matrix( GLmatrix *dest, const GLmatrix *a, const GLmatrix *b )
{
dest->flags = (a->flags |
b->flags |
- MAT_DIRTY_TYPE |
+ MAT_DIRTY_TYPE |
MAT_DIRTY_INVERSE);
if (TEST_MAT_FLAGS(dest, MAT_FLAGS_3D))
matmul34( dest->m, a->m, b->m );
- else
+ else
matmul4( dest->m, a->m, b->m );
}
-void
+void
_math_matrix_mul_floats( GLmatrix *dest, const GLfloat *m )
{
dest->flags |= (MAT_FLAG_GENERAL |
- MAT_DIRTY_TYPE |
+ MAT_DIRTY_TYPE |
MAT_DIRTY_INVERSE);
- matmul4( dest->m, dest->m, m );
+ matmul4( dest->m, dest->m, m );
}
-void
+void
_math_matrix_set_identity( GLmatrix *mat )
{
MEMCPY( mat->m, Identity, 16*sizeof(GLfloat) );
-void
+void
_math_transposef( GLfloat to[16], const GLfloat from[16] )
{
to[0] = from[0];
}
-void
+void
_math_transposed( GLdouble to[16], const GLdouble from[16] )
{
to[0] = from[0];
to[15] = from[15];
}
-void
+void
_math_transposefd( GLfloat to[16], const GLdouble from[16] )
{
to[0] = from[0];
-/* $Id: m_matrix.h,v 1.3 2001/02/05 18:48:52 brianp Exp $ */
+/* $Id: m_matrix.h,v 1.4 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
extern void
_math_matrix_mul_floats( GLmatrix *dest, const GLfloat *b );
-extern void
+extern void
_math_matrix_loadf( GLmatrix *mat, const GLfloat *m );
-extern void
+extern void
_math_matrix_translate( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z );
extern void
-_math_matrix_rotate( GLmatrix *m, GLfloat angle,
+_math_matrix_rotate( GLmatrix *m, GLfloat angle,
GLfloat x, GLfloat y, GLfloat z );
-extern void
+extern void
_math_matrix_scale( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z );
extern void
-_math_matrix_ortho( GLmatrix *mat,
+_math_matrix_ortho( GLmatrix *mat,
GLfloat left, GLfloat right,
- GLfloat bottom, GLfloat top,
+ GLfloat bottom, GLfloat top,
GLfloat nearval, GLfloat farval );
extern void
-_math_matrix_frustum( GLmatrix *mat,
+_math_matrix_frustum( GLmatrix *mat,
GLfloat left, GLfloat right,
- GLfloat bottom, GLfloat top,
+ GLfloat bottom, GLfloat top,
GLfloat nearval, GLfloat farval );
extern void
_math_matrix_set_identity( GLmatrix *dest );
-extern void
+extern void
_math_matrix_copy( GLmatrix *to, const GLmatrix *from );
extern void
-/* $Id: m_norm_tmp.h,v 1.4 2001/03/03 20:57:00 brianp Exp $ */
+/* $Id: m_norm_tmp.h,v 1.5 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
const GLubyte mask[],
GLvector3f *dest )
{
- GLuint i;
+ GLuint i;
const GLfloat *from = in->start;
GLuint stride = in->stride;
GLuint count = in->count;
const GLubyte mask[],
GLvector3f *dest )
{
- GLuint i;
+ GLuint i;
const GLfloat *from = in->start;
GLuint stride = in->stride;
GLuint count = in->count;
/* scale has been snapped to 1.0 if it is close.
*/
if (scale != 1.0) {
- m0 *= scale;
+ m0 *= scale;
m5 *= scale;
m10 *= scale;
}
const GLubyte mask[],
GLvector3f *dest )
{
- GLuint i;
+ GLuint i;
const GLfloat *from = in->start;
GLuint stride = in->stride;
GLuint count = in->count;
const GLubyte mask[],
GLvector3f *dest )
{
- GLuint i;
+ GLuint i;
const GLfloat *from = in->start;
GLuint stride = in->stride;
GLuint count = in->count;
const GLubyte mask[],
GLvector3f *dest )
{
- GLuint i;
+ GLuint i;
const GLfloat *from = in->start;
GLuint stride = in->stride;
GLuint count = in->count;
const GLubyte mask[],
GLvector3f *dest )
{
- GLuint i;
+ GLuint i;
const GLfloat *from = in->start;
GLuint stride = in->stride;
GLuint count = in->count;
const GLubyte mask[],
GLvector3f *dest )
{
- GLuint i;
+ GLuint i;
const GLfloat *from = in->start;
GLuint stride = in->stride;
GLuint count = in->count;
out[i][0] = x * invlen;
out[i][1] = y * invlen;
out[i][2] = z * invlen;
- }
+ }
}
}
else {
out[i][1] = y;
out[i][2] = z;
}
- }
+ }
}
}
dest->count = in->count;
const GLubyte mask[],
GLvector3f *dest )
{
- GLuint i;
+ GLuint i;
const GLfloat *from = in->start;
GLuint stride = in->stride;
GLuint count = in->count;
static void _XFORMAPI
TAG(init_c_norm_transform)( void )
{
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT][IDX] =
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT][IDX] =
TAG(transform_normals_no_rot);
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE][IDX] =
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE][IDX] =
TAG(transform_rescale_normals_no_rot);
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE][IDX] =
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE][IDX] =
TAG(transform_normalize_normals_no_rot);
- _mesa_normal_tab[NORM_TRANSFORM][IDX] =
+ _mesa_normal_tab[NORM_TRANSFORM][IDX] =
TAG(transform_normals);
- _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE][IDX] =
+ _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE][IDX] =
TAG(transform_rescale_normals);
- _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE][IDX] =
+ _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE][IDX] =
TAG(transform_normalize_normals);
- _mesa_normal_tab[NORM_RESCALE][IDX] =
+ _mesa_normal_tab[NORM_RESCALE][IDX] =
TAG(rescale_normals);
- _mesa_normal_tab[NORM_NORMALIZE][IDX] =
+ _mesa_normal_tab[NORM_NORMALIZE][IDX] =
TAG(normalize_normals);
}
-/* $Id: m_trans_tmp.h,v 1.3 2001/01/24 00:04:59 brianp Exp $ */
+/* $Id: m_trans_tmp.h,v 1.4 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
(void) first;
(void) start;
for (i = DST_START ; i < n ; i++, NEXT_F) {
- CHECK {
+ CHECK {
NEXT_F2;
if (SZ >= 1) t[i][0] = TRX_4F(f, 0);
if (SZ >= 2) t[i][1] = TRX_4F(f, 1);
NEXT_F2;
if (SZ >= 1) TRX_UB(t[i][0], f, 0);
if (SZ >= 2) TRX_UB(t[i][1], f, 1);
- if (SZ >= 3) TRX_UB(t[i][2], f, 2);
+ if (SZ >= 3) TRX_UB(t[i][2], f, 2);
if (SZ == 4) TRX_UB(t[i][3], f, 3); else t[i][3] = 255;
}
}
NEXT_F2;
if (SZ >= 1) TRX_US(t[i][0], f, 0);
if (SZ >= 2) TRX_US(t[i][1], f, 1);
- if (SZ >= 3) TRX_US(t[i][2], f, 2);
+ if (SZ >= 3) TRX_US(t[i][2], f, 2);
if (SZ == 4) TRX_US(t[i][3], f, 3); else t[i][3] = 65535;
}
}
#ifdef DEST_4F
TAB(_4f)[SZ][SRC_IDX] = DEST_4F;
#endif
-
+
}
#undef DEST_1F
#undef SZ
#undef TAG
-
-
-/* $Id: m_translate.c,v 1.5 2001/02/20 18:28:52 keithw Exp $ */
+/* $Id: m_translate.c,v 1.6 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
typedef void (*trans_1f_func)(GLfloat *to,
CONST void *ptr,
GLuint stride,
- GLuint start,
+ GLuint start,
GLuint n );
typedef void (*trans_1ui_func)(GLuint *to,
CONST void *ptr,
GLuint stride,
- GLuint start,
+ GLuint start,
GLuint n );
typedef void (*trans_1ub_func)(GLubyte *to,
typedef void (*trans_4f_func)(GLfloat (*to)[4],
CONST void *ptr,
GLuint stride,
- GLuint start,
+ GLuint start,
GLuint n );
typedef void (*trans_3f_func)(GLfloat (*to)[3],
CONST void *ptr,
GLuint stride,
- GLuint start,
+ GLuint start,
GLuint n );
#define SRC GLfloat
#define SRC_IDX TYPE_IDX(GL_FLOAT)
#define SZ 4
-#define INIT init_trans_4_GLfloat_raw
-#define DEST_4UB trans_4_GLfloat_4ub_raw
-#define DEST_4US trans_4_GLfloat_4us_raw
+#define INIT init_trans_4_GLfloat_raw
+#define DEST_4UB trans_4_GLfloat_4ub_raw
+#define DEST_4US trans_4_GLfloat_4us_raw
#define DEST_4F trans_4_GLfloat_4f_raw
#include "m_trans_tmp.h"
const GLubyte *f = (GLubyte *) Ptr + SRC_START * stride;
GLuint i;
- if (((((long) f | (long) stride)) & 3L) == 0L) {
+ if (((((long) f | (long) stride)) & 3L) == 0L) {
/* Aligned.
*/
for (i = DST_START ; i < n ; i++, f += stride) {
GLuint start,
GLuint n )
{
- _math_trans_1ui_tab[TYPE_IDX(type)]( to, ptr, stride, start, n );
+ _math_trans_1ui_tab[TYPE_IDX(type)]( to, ptr, stride, start, n );
}
void _math_trans_1ub(GLubyte *to,
GLuint start,
GLuint n )
{
- _math_trans_1ub_tab[TYPE_IDX(type)]( to, ptr, stride, start, n );
+ _math_trans_1ub_tab[TYPE_IDX(type)]( to, ptr, stride, start, n );
}
GLuint start,
GLuint n )
{
- _math_trans_4ub_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n );
+ _math_trans_4ub_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n );
}
void _math_trans_4chan( GLchan (*to)[4],
GLuint start,
GLuint n )
{
- _math_trans_4us_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n );
+ _math_trans_4us_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n );
}
void _math_trans_4f(GLfloat (*to)[4],
GLuint start,
GLuint n )
{
- _math_trans_4f_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n );
+ _math_trans_4f_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n );
}
void _math_trans_3f(GLfloat (*to)[3],
GLuint start,
GLuint n )
{
- _math_trans_3f_tab[TYPE_IDX(type)]( to, ptr, stride, start, n );
+ _math_trans_3f_tab[TYPE_IDX(type)]( to, ptr, stride, start, n );
}
-
-/* $Id: m_translate.h,v 1.5 2001/02/20 18:28:52 keithw Exp $ */
+/* $Id: m_translate.h,v 1.6 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/* $Id: m_vector.c,v 1.5 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: m_vector.c,v 1.6 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
{
static const GLubyte elem_bits[4] = {
VEC_DIRTY_0,
- VEC_DIRTY_1,
- VEC_DIRTY_2,
+ VEC_DIRTY_1,
+ VEC_DIRTY_2,
VEC_DIRTY_3
};
static const GLfloat clean[4] = { 0, 0, 0, 1 };
const GLfloat v = clean[elt];
GLfloat (*data)[4] = (GLfloat (*)[4])vec->start;
- GLuint i;
+ GLuint i;
for (i = 0 ; i < count ; i++)
data[i][elt] = v;
{
v->stride = 1 * sizeof(GLubyte);
v->storage = ALIGN_MALLOC( count * sizeof(GLubyte), alignment );
- v->start = (GLubyte *) v->storage;
+ v->start = (GLubyte *) v->storage;
v->data = (GLubyte *) v->storage;
v->count = 0;
v->flags = flags | VEC_MALLOC ;
{
v->stride = 1 * sizeof(GLuint);
v->storage = ALIGN_MALLOC( count * sizeof(GLuint), alignment );
- v->start = (GLuint *) v->storage;
+ v->start = (GLuint *) v->storage;
v->data = (GLuint *) v->storage;
v->count = 0;
v->flags = flags | VEC_MALLOC ;
GLuint j, i = 0, count;
printf("data-start\n");
- for ( ; d != v->start ; STRIDE_F(d, v->stride), i++)
+ for ( ; d != v->start ; STRIDE_F(d, v->stride), i++)
printf( t, i, d[0], d[1], d[2], d[3]);
-
+
printf("start-count(%u)\n", v->count);
count = i + v->count;
if (culling) {
- for ( ; i < count ; STRIDE_F(d, v->stride), i++)
- if (cullmask[i])
- printf( t, i, d[0], d[1], d[2], d[3]);
+ for ( ; i < count ; STRIDE_F(d, v->stride), i++)
+ if (cullmask[i])
+ printf( t, i, d[0], d[1], d[2], d[3]);
}
else {
- for ( ; i < count ; STRIDE_F(d, v->stride), i++)
- printf( t, i, d[0], d[1], d[2], d[3]);
+ for ( ; i < count ; STRIDE_F(d, v->stride), i++)
+ printf( t, i, d[0], d[1], d[2], d[3]);
}
for (j = v->size ; j < 4; j++) {
printf("checking col %u is clean as advertised ", j);
- for (i = 0, d = (GLfloat *) v->data ;
- i < count && d[j] == c[j] ;
+ for (i = 0, d = (GLfloat *) v->data ;
+ i < count && d[j] == c[j] ;
i++, STRIDE_F(d, v->stride)) {};
- if (i == count)
+ if (i == count)
printf(" --> ok\n");
- else
+ else
printf(" --> Failed at %u ******\n", i);
}
}
GLuint i = 0, count;
printf("data-start\n");
- for ( ; d != v->start ; STRIDE_F(d,v->stride), i++)
+ for ( ; d != v->start ; STRIDE_F(d,v->stride), i++)
printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
-
+
printf("start-count(%u)\n", v->count);
count = i + v->count;
if (culling) {
- for ( ; i < count ; STRIDE_F(d,v->stride), i++)
+ for ( ; i < count ; STRIDE_F(d,v->stride), i++)
if (cullmask[i])
- printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
+ printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
}
else {
- for ( ; i < count ; STRIDE_F(d,v->stride), i++)
- printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
+ for ( ; i < count ; STRIDE_F(d,v->stride), i++)
+ printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
}
}
-/* $Id: m_vector.h,v 1.5 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: m_vector.h,v 1.6 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
#include "mtypes.h" /* hack for GLchan */
-#define VEC_DIRTY_0 0x1
+#define VEC_DIRTY_0 0x1
#define VEC_DIRTY_1 0x2
#define VEC_DIRTY_2 0x4
#define VEC_DIRTY_3 0x8
/* Wrap all the information about vectors up in a struct. Has
* additional fields compared to the other vectors to help us track of
* different vertex sizes, and whether we need to clean columns out
- * because they contain non-(0,0,0,1) values.
+ * because they contain non-(0,0,0,1) values.
*
* The start field is used to reserve data for copied vertices at the
* end of _mesa_transform_vb, and avoids the need for a multiplication in
/* Could use a single vector type for normals and vertices, but
- * this way avoids some casts.
+ * this way avoids some casts.
*/
typedef struct {
- GLfloat (*data)[3];
+ GLfloat (*data)[3];
GLfloat *start;
GLuint count;
GLuint stride;
typedef struct {
- GLfloat *data;
+ GLfloat *data;
GLfloat *start;
GLuint count;
GLuint stride;
GLubyte (*data)[4];
GLubyte *start;
GLuint count;
- GLuint stride;
- GLuint flags;
+ GLuint stride;
+ GLuint flags;
void *storage;
} GLvector4ub;
-extern void _mesa_vector4ub_init( GLvector4ub *v, GLuint flags,
+extern void _mesa_vector4ub_init( GLvector4ub *v, GLuint flags,
GLubyte (*storage)[4] );
extern void _mesa_vector4ub_alloc( GLvector4ub *v, GLuint flags, GLuint count,
GLuint alignment );
GLchan (*data)[4];
GLchan *start;
GLuint count;
- GLuint stride;
- GLuint flags;
+ GLuint stride;
+ GLuint flags;
void *storage;
} GLvector4chan;
-extern void _mesa_vector4chan_init( GLvector4chan *v, GLuint flags,
+extern void _mesa_vector4chan_init( GLvector4chan *v, GLuint flags,
GLchan (*storage)[4] );
extern void _mesa_vector4chan_alloc( GLvector4chan *v, GLuint flags, GLuint count,
GLuint alignment );
GLushort (*data)[4];
GLushort *start;
GLuint count;
- GLuint stride;
- GLuint flags;
+ GLuint stride;
+ GLuint flags;
void *storage;
} GLvector4us;
-extern void _mesa_vector4us_init( GLvector4us *v, GLuint flags,
+extern void _mesa_vector4us_init( GLvector4us *v, GLuint flags,
GLushort (*storage)[4] );
extern void _mesa_vector4us_alloc( GLvector4us *v, GLuint flags, GLuint count,
GLuint alignment );
GLubyte *data;
GLubyte *start;
GLuint count;
- GLuint stride;
- GLuint flags;
+ GLuint stride;
+ GLuint flags;
void *storage;
} GLvector1ub;
GLuint *data;
GLuint *start;
GLuint count;
- GLuint stride;
- GLuint flags;
+ GLuint stride;
+ GLuint flags;
void *storage;
} GLvector1ui;
extern void _mesa_vector1ui_init( GLvector1ui *v, GLuint flags, GLuint *storage );
-extern void _mesa_vector1ui_alloc( GLvector1ui *v, GLuint flags, GLuint count,
+extern void _mesa_vector1ui_alloc( GLvector1ui *v, GLuint flags, GLuint count,
GLuint alignment );
extern void _mesa_vector1ui_free( GLvector1ui * );
-/* $Id: m_xform.c,v 1.10 2001/03/03 20:57:00 brianp Exp $ */
+/* $Id: m_xform.c,v 1.11 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: m_xform.h,v 1.7 2001/03/03 20:57:00 brianp Exp $ */
+/* $Id: m_xform.h,v 1.8 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
CONST GLfloat m[16] );
-extern void
+extern void
_math_init_transformation( void );
*
* There are two cases where we wouldn't want to do the divide in cliptest:
* - When we aren't clipping. We still might want to cull backfaces
- * so the divide should be done elsewhere. This currently never
+ * so the divide should be done elsewhere. This currently never
* happens.
*
* - When culling isn't likely to help us, such as when the GL culling
* application wouldn't turn on culling in such cases.
*
* We supply a buffer to hold the [x/w,y/w,z/w,1/w] values which
- * are the result of the projection. This is only used in the
+ * are the result of the projection. This is only used in the
* 4-vector case - in other cases, we just use the clip coordinates
* as the projected coordinates - they are identical.
- *
+ *
* This is doubly convenient because it means the Win[] array is now
* of the same stride as all the others, so I can now turn map_vertices
* into a straight-forward matrix transformation, with asm acceleration
- * automatically available.
+ * automatically available.
*/
-/* Vertex buffer clipping flags
+/* Vertex buffer clipping flags
*/
#define CLIP_RIGHT_SHIFT 0
#define CLIP_LEFT_SHIFT 1
typedef GLvector4f * (_XFORMAPIP clip_func)( GLvector4f *vClip,
- GLvector4f *vProj,
+ GLvector4f *vProj,
GLubyte clipMask[],
- GLubyte *orMask,
+ GLubyte *orMask,
GLubyte *andMask );
-typedef void (*dotprod_func)( GLfloat *out,
+typedef void (*dotprod_func)( GLfloat *out,
GLuint out_stride,
- CONST GLvector4f *coord_vec,
- CONST GLfloat plane[4],
+ CONST GLvector4f *coord_vec,
+ CONST GLfloat plane[4],
CONST GLubyte mask[]);
-typedef void (*vec_copy_func)( GLvector4f *to,
- CONST GLvector4f *from,
+typedef void (*vec_copy_func)( GLvector4f *to,
+ CONST GLvector4f *from,
CONST GLubyte mask[]);
GLvector3f *dest );
-/* Flags for selecting a normal transformation function.
+/* Flags for selecting a normal transformation function.
*/
#define NORM_RESCALE 0x1 /* apply the scale factor */
#define NORM_NORMALIZE 0x2 /* normalize */
/* KW: New versions of the transform function allow a mask array
* specifying that individual vector transform should be skipped
* when the mask byte is zero. This is always present as a
- * parameter, to allow a unified interface.
+ * parameter, to allow a unified interface.
*/
typedef void (_XFORMAPIP transform_func)( GLvector4f *to_vec,
CONST GLfloat m[16],
- CONST GLvector4f *from_vec,
+ CONST GLvector4f *from_vec,
CONST GLubyte *clipmask,
CONST GLubyte flag );
-/* $Id: m_xform_tmp.h,v 1.3 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: m_xform_tmp.h,v 1.4 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
+/* $Id: mathmod.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
#ifndef _MESA_MATH_H_
#define _MESA_MATH_H_
-/* $Id: s_aaline.c,v 1.5 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_aaline.c,v 1.6 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
swrast->Line = aa_ci_line;
}
}
-
-/* $Id: s_aaline.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_aaline.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: s_aalinetemp.h,v 1.6 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_aalinetemp.h,v 1.7 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/* $Id: s_aatriangle.c,v 1.8 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_aatriangle.c,v 1.9 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/* $Id: s_aatriangle.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_aatriangle.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: s_aatritemp.h,v 1.7 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_aatritemp.h,v 1.8 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
/* plane setup */
#ifdef DO_Z
compute_plane(p0, p1, p2, p0[2], p1[2], p2[2], zPlane);
- compute_plane(p0, p1, p2,
- v0->fog,
- v1->fog,
- v2->fog,
+ compute_plane(p0, p1, p2,
+ v0->fog,
+ v1->fog,
+ v2->fog,
fogPlane);
#endif
#ifdef DO_RGBA
(const GLchan (*)[4]) (spec + left),
GL_POLYGON);
# else
- _mesa_write_texture_span(ctx, n, left, iy, z + left, fog + left,
+ _mesa_write_texture_span(ctx, n, left, iy, z + left, fog + left,
s + left, t + left,
u + left, lambda + left,
rgba + left, NULL, GL_POLYGON);
# endif
#elif defined(DO_RGBA)
- _mesa_write_rgba_span(ctx, n, left, iy, z + left, fog + left,
+ _mesa_write_rgba_span(ctx, n, left, iy, z + left, fog + left,
rgba + left, GL_POLYGON);
#elif defined(DO_INDEX)
- _mesa_write_index_span(ctx, n, left, iy, z + left, fog + left,
+ _mesa_write_index_span(ctx, n, left, iy, z + left, fog + left,
index + left, GL_POLYGON);
#endif
}
-/* $Id: s_accum.c,v 1.7 2001/03/08 15:23:46 brianp Exp $ */
+/* $Id: s_accum.c,v 1.8 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
void
_swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
- GLint xpos, GLint ypos,
+ GLint xpos, GLint ypos,
GLint width, GLint height )
{
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
const GLint iChanMax = (1 << (sizeof(GLchan) * 8)) - 1;
const GLfloat fChanMax = (1 << (sizeof(GLchan) * 8)) - 1;
-
+
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
if (!ctx->DrawBuffer->Accum) {
- _mesa_warning(ctx,
+ _mesa_warning(ctx,
"Calling glAccum() without an accumulation "
"buffer (low memory?)");
return;
swrast->_IntegerAccumScaler = value;
if (swrast->_IntegerAccumMode && value != swrast->_IntegerAccumScaler)
rescale_accum(ctx);
-
+
RENDER_START(ctx);
if (swrast->_IntegerAccumMode) {
assert(swrast->_IntegerAccumScaler > 0.0);
assert(swrast->_IntegerAccumScaler <= 1.0);
for (j = 0; j < height; j++) {
-
+
GLint i, i4;
_mesa_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
for (i = i4 = 0; i < width; i++, i4+=4) {
if (colorMask != 0xffffffff) {
_mesa_mask_rgba_span( ctx, width, xpos, ypos, rgba );
}
- (*ctx->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
+ (*ctx->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
(const GLchan (*)[4])rgba, NULL );
if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
&& ctx->Color.ColorMask[ACOMP]) {
if (colorMask != 0xffffffff) {
_mesa_mask_rgba_span( ctx, width, xpos, ypos, rgba );
}
- (*ctx->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
+ (*ctx->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
(const GLchan (*)[4])rgba, NULL );
if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
&& ctx->Color.ColorMask[ACOMP]) {
-/* $Id: s_accum.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_accum.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: s_alpha.c,v 1.3 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_alpha.c,v 1.4 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
}
return 1;
case GL_LEQUAL:
- for (i=0;i<n;i++)
+ for (i=0;i<n;i++)
mask[i] &= (rgba[i][ACOMP] <= ref);
return 1;
case GL_GEQUAL:
-/* $Id: s_alpha.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_alpha.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: s_alphabuf.c,v 1.5 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_alphabuf.c,v 1.6 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* Input: ctx - the context
*
*/
-static void
+static void
alloc_alpha_buffers( GLcontext *ctx, GLframebuffer *buf )
{
GLint bytes = buf->Width * buf->Height * sizeof(GLchan);
}
}
}
-
-
-
-/* $Id: s_alphabuf.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_alphabuf.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#endif
-
-/* $Id: s_bitmap.c,v 1.5 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_bitmap.c,v 1.6 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
/*
* Render a bitmap.
*/
-void
+void
_swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
GLsizei width, GLsizei height,
const struct gl_pixelstore_attrib *unpack,
}
fragZ = (GLdepth) ( ctx->Current.RasterPos[2] * ctx->DepthMaxF);
-
+
_mesa_win_fog_coords_from_z( ctx, 1, &fragZ, &fogCoord );
for (row=0; row<height; row++) {
_mesa_flush_pb(ctx);
}
-
-
-
-/* $Id: s_blend.c,v 1.5 2001/03/08 15:23:46 brianp Exp $ */
+/* $Id: s_blend.c,v 1.6 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
SWRAST_CONTEXT(ctx)->BlendFunc = blend_general;
}
else if (eq==GL_FUNC_ADD_EXT && srcRGB==GL_SRC_ALPHA
- && dstRGB==GL_ONE_MINUS_SRC_ALPHA)
+ && dstRGB==GL_ONE_MINUS_SRC_ALPHA)
{
#if defined(USE_MMX_ASM)
if ( cpu_has_mmx ) {
/* Read span of current frame buffer pixels */
_mesa_read_rgba_span( ctx, ctx->DrawBuffer, n, x, y, dest );
- SWRAST_CONTEXT(ctx)->BlendFunc( ctx, n, mask, rgba,
+ SWRAST_CONTEXT(ctx)->BlendFunc( ctx, n, mask, rgba,
(const GLchan (*)[4]) dest );
}
swrast->BlendFunc( ctx, n, mask, rgba, (const GLchan (*)[4])dest );
}
-
-
-/* $Id: s_blend.h,v 1.3 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_blend.h,v 1.4 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: s_buffers.c,v 1.6 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_buffers.c,v 1.7 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
(void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT);
(void) (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_BACK_RIGHT);
}
-
+
if (colorMask != 0xffffffff) {
clear_color_buffer_with_masking(ctx);
}
-void
+void
_swrast_Clear( GLcontext *ctx, GLbitfield mask,
- GLboolean all,
+ GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
_mesa_alloc_alpha_buffers( ctx );
}
}
-
-
-/* $Id: s_context.c,v 1.16 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_context.c,v 1.17 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
_swrast_validate_derived( ctx );
swrast->choose_triangle( ctx );
- if ((ctx->_TriangleCaps & DD_SEPERATE_SPECULAR) &&
+ if ((ctx->_TriangleCaps & DD_SEPERATE_SPECULAR) &&
!ctx->Texture._ReallyEnabled) {
swrast->SpecTriangle = swrast->Triangle;
swrast->Triangle = _swrast_add_spec_terms_triangle;
_swrast_validate_derived( ctx );
swrast->choose_line( ctx );
- if ((ctx->_TriangleCaps & DD_SEPERATE_SPECULAR) &&
+ if ((ctx->_TriangleCaps & DD_SEPERATE_SPECULAR) &&
!ctx->Texture._ReallyEnabled) {
swrast->SpecLine = swrast->Line;
swrast->Line = _swrast_add_spec_terms_line;
_swrast_validate_derived( ctx );
swrast->choose_point( ctx );
- if ((ctx->_TriangleCaps & DD_SEPERATE_SPECULAR) &&
+ if ((ctx->_TriangleCaps & DD_SEPERATE_SPECULAR) &&
!ctx->Texture._ReallyEnabled) {
swrast->SpecPoint = swrast->Point;
swrast->Point = _swrast_add_spec_terms_point;
{
GLuint i;
- fprintf(stderr, "win %f %f %f %f\n",
+ fprintf(stderr, "win %f %f %f %f\n",
v->win[0], v->win[1], v->win[2], v->win[3]);
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
fprintf(stderr, "texcoord[%d] %f %f %f %f\n", i,
- v->texcoord[i][0], v->texcoord[i][1],
+ v->texcoord[i][0], v->texcoord[i][1],
v->texcoord[i][2], v->texcoord[i][3]);
- fprintf(stderr, "color %d %d %d %d\n",
+ fprintf(stderr, "color %d %d %d %d\n",
v->color[0], v->color[1], v->color[2], v->color[3]);
fprintf(stderr, "spec %d %d %d %d\n",
v->specular[0], v->specular[1], v->specular[2], v->specular[3]);
-/* $Id: s_context.h,v 1.6 2001/03/07 04:50:49 brianp Exp $ */
+/* $Id: s_context.h,v 1.7 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
swrast_tri_func Triangle;
/* Placeholders for when seperate specular (or secondary color) is
- * enabled but texturing is not.
+ * enabled but texturing is not.
*/
swrast_point_func SpecPoint;
swrast_line_func SpecLine;
-/* $Id: s_copypix.c,v 1.14 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_copypix.c,v 1.15 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
dy = desty + row;
if (quick_draw && dy >= 0 && dy < ctx->DrawBuffer->Height) {
- (*ctx->Driver.WriteRGBASpan)( ctx, width, destx, dy,
+ (*ctx->Driver.WriteRGBASpan)( ctx, width, destx, dy,
(const GLchan (*)[4])rgba, NULL );
}
else if (zoom) {
- _mesa_write_zoomed_rgba_span( ctx, width, destx, dy, zspan, 0,
+ _mesa_write_zoomed_rgba_span( ctx, width, destx, dy, zspan, 0,
(const GLchan (*)[4])rgba, desty);
}
else {
}
if (quick_draw && dy >= 0 && dy < ctx->DrawBuffer->Height) {
- (*ctx->Driver.WriteRGBASpan)( ctx, width, destx, dy,
+ (*ctx->Driver.WriteRGBASpan)( ctx, width, destx, dy,
(const GLchan (*)[4])rgba, NULL );
}
else if (zoom) {
(const GLchan (*)[4])rgba, desty );
}
else {
- _mesa_write_rgba_span( ctx, width, destx, dy, zspan, 0,
+ _mesa_write_rgba_span( ctx, width, destx, dy, zspan, 0,
rgba, GL_BITMAP);
}
}
-/* $Id: s_depth.c,v 1.7 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_depth.c,v 1.8 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/* $Id: s_depth.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_depth.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: s_drawpix.c,v 1.13 2001/03/08 15:23:46 brianp Exp $ */
+/* $Id: s_drawpix.c,v 1.14 2001/03/12 00:48:41 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
ASSERT(drawWidth < MAX_WIDTH);
_mesa_map_ci8_to_rgba(ctx, drawWidth, src, rgba);
(*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
- (const GLchan (*)[4]) rgba,
+ (const GLchan (*)[4]) rgba,
NULL);
src += rowLength;
destY++;
_mesa_map_ci8_to_rgba(ctx, drawWidth, src, rgba);
destY--;
(*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
- (CONST GLchan (*)[4]) rgba,
+ (CONST GLchan (*)[4]) rgba,
NULL);
src += rowLength;
}
* Do glDrawPixels of stencil image. The image datatype may either
* be GLubyte or GLbitmap.
*/
-static void
+static void
draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum type, const GLvoid *pixels )
* Execute glDrawPixels
*/
void
-_swrast_DrawPixels( GLcontext *ctx,
+_swrast_DrawPixels( GLcontext *ctx,
GLint x, GLint y,
GLsizei width, GLsizei height,
- GLenum format, GLenum type,
+ GLenum format, GLenum type,
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels )
{
_mesa_error( ctx, GL_INVALID_ENUM, "glDrawPixels(format)" );
}
}
-
-/* $Id: s_drawpix.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_drawpix.h,v 1.3 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: s_feedback.c,v 1.6 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_feedback.c,v 1.7 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
if (_mesa_cull_triangle( ctx, v0, v1, v2 )) {
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_POLYGON_TOKEN );
FEEDBACK_TOKEN( ctx, (GLfloat) 3 ); /* three vertices */
-
+
if (ctx->Light.ShadeModel == GL_SMOOTH) {
feedback_vertex( ctx, v0, v0 );
feedback_vertex( ctx, v1, v1 );
GLenum token = GL_LINE_TOKEN;
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (swrast->StippleCounter==0)
+ if (swrast->StippleCounter==0)
token = GL_LINE_RESET_TOKEN;
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) token );
const GLfloat zs = 1.0F / ctx->DepthMaxF;
_mesa_update_hitflag( ctx, v->win[2] * zs );
}
-
-
-
-/* $Id: s_feedback.h,v 1.4 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_feedback.h,v 1.5 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
const SWvertex *v1, const SWvertex *v2 );
#endif
-
-/* $Id: s_fog.c,v 1.10 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_fog.c,v 1.11 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
*/
void
_mesa_fog_rgba_pixels( const GLcontext *ctx,
- GLuint n,
- const GLfixed fog[],
+ GLuint n,
+ const GLfixed fog[],
GLchan rgba[][4] )
{
GLuint i;
/*
- * Calculate fog coords from window z values
+ * Calculate fog coords from window z values
* Input: n - number of pixels
* z - array of integer depth values
* red, green, blue, alpha - pixel colors
* Output: red, green, blue, alpha - fogged pixel colors
*
- * Use lookup table & interpolation?
+ * Use lookup table & interpolation?
*/
void
_mesa_win_fog_coords_from_z( const GLcontext *ctx,
- GLuint n,
- const GLdepth z[],
+ GLuint n,
+ const GLdepth z[],
GLfixed fogcoord[] )
{
const GLboolean ortho = (ctx->ProjectionMatrix.m[15] != 0.0F);
_mesa_win_fog_coords_from_z( ctx, n, z, fog );
_mesa_fog_ci_pixels( ctx, n, fog, index );
}
-
-/* $Id: s_fog.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_fog.h,v 1.3 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: s_lines.c,v 1.13 2001/03/08 17:33:33 brianp Exp $ */
+/* $Id: s_lines.c,v 1.14 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
}
-void _swrast_add_spec_terms_line( GLcontext *ctx,
+void _swrast_add_spec_terms_line( GLcontext *ctx,
const SWvertex *v0,
const SWvertex *v1 )
{
-/* $Id: s_lines.h,v 1.4 2001/02/16 18:14:41 keithw Exp $ */
+/* $Id: s_lines.h,v 1.5 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
void
_swrast_choose_line( GLcontext *ctx );
-void
-_swrast_add_spec_terms_line( GLcontext *ctx,
+void
+_swrast_add_spec_terms_line( GLcontext *ctx,
const SWvertex *v0,
const SWvertex *v1 );
-/* $Id: s_linetemp.h,v 1.6 2001/03/08 17:33:33 brianp Exp $ */
+/* $Id: s_linetemp.h,v 1.7 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
*
* To enable line stippling define STIPPLE = 1
* To enable wide lines define WIDE = 1
- *
+ *
* To actually "plot" each pixel either the PLOT macro or
* (XMAJOR_PLOT and YMAJOR_PLOT macros) must be defined...
* PLOT(X,Y) - code to plot a pixel. Example:
#endif
#ifdef INTERP_FOG
GLfixed fog0 = FloatToFixed(vert0->fog);
- GLfixed dfog = FloatToFixed(vert1->fog) - fog0;
+ GLfixed dfog = FloatToFixed(vert1->fog) - fog0;
#endif
#ifdef INTERP_RGB
GLfixed r0 = IntToFixed(vert0->color[0]);
-/* $Id: s_logic.c,v 1.4 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_logic.c,v 1.5 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/* $Id: s_logic.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_logic.h,v 1.3 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: s_masking.c,v 1.3 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_masking.c,v 1.4 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
index[i] = (index[i] & msrc) | (fbindexes[i] & mdest);
}
}
-
-/* $Id: s_masking.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_masking.h,v 1.3 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#endif
-
-/* $Id: s_pixeltex.c,v 1.2 2000/11/05 18:24:40 keithw Exp $ */
+/* $Id: s_pixeltex.c,v 1.3 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/* $Id: s_pixeltex.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_pixeltex.h,v 1.3 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
- * The above copyright noti_mesa_PixelTexGenParameterfvce and this permission notice shall be included
+ * The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-/* $Id: s_points.c,v 1.14 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_points.c,v 1.15 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-void _swrast_add_spec_terms_point( GLcontext *ctx,
+void _swrast_add_spec_terms_point( GLcontext *ctx,
const SWvertex *v0 )
{
SWvertex *ncv0 = (SWvertex *)v0;
* Examine the current context to determine which point drawing function
* should be used.
*/
-void
+void
_swrast_choose_point( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
USE(_mesa_select_point);
}
}
-
-/* $Id: s_points.h,v 1.4 2001/02/16 18:14:41 keithw Exp $ */
+/* $Id: s_points.h,v 1.5 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
void
_swrast_choose_point( GLcontext *ctx );
-void
-_swrast_add_spec_terms_point( GLcontext *ctx,
+void
+_swrast_add_spec_terms_point( GLcontext *ctx,
const SWvertex *v0 );
#endif
-/* $Id: s_pointtemp.h,v 1.4 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_pointtemp.h,v 1.5 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
texcoord[u][0] = vert->texcoord[u][0] / vert->texcoord[u][3];
texcoord[u][1] = vert->texcoord[u][1] / vert->texcoord[u][3];
texcoord[u][2] = vert->texcoord[u][2] / vert->texcoord[u][3];
- }
+ }
else {
texcoord[u][0] = vert->texcoord[u][0];
texcoord[u][1] = vert->texcoord[u][1];
-/* $Id: s_readpix.c,v 1.9 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_readpix.c,v 1.10 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
void
_swrast_ReadPixels( GLcontext *ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
+ GLenum format, GLenum type,
const struct gl_pixelstore_attrib *pack,
GLvoid *pixels )
{
-/* $Id: s_span.c,v 1.10 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_span.c,v 1.11 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
}
else {
/* partially off left side */
- BZERO(mask, -x * sizeof(GLubyte));
+ BZERO(mask, -x * sizeof(GLubyte));
}
}
void _mesa_write_monoindex_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y,
+ GLuint n, GLint x, GLint y,
const GLdepth z[],
const GLfixed fog[],
GLuint index, GLenum primitive )
_mesa_mask_rgba_span( ctx, n, x, y, rgbaTmp );
}
- (*ctx->Driver.WriteRGBASpan)( ctx, n, x, y,
+ (*ctx->Driver.WriteRGBASpan)( ctx, n, x, y,
(const GLchan (*)[4]) rgbaTmp, mask );
if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_span( ctx, n, x, y,
+ _mesa_write_alpha_span( ctx, n, x, y,
(const GLchan (*)[4])rgbaTmp, mask );
}
}
/* Per-pixel fog */
if (ctx->Fog.Enabled) {
- if (fog && !swrast->_PreferPixelFog)
+ if (fog && !swrast->_PreferPixelFog)
_mesa_fog_rgba_pixels( ctx, n, fog, rgba );
else
_mesa_depth_fog_rgba_pixels( ctx, n, z, rgba );
}
/* write pixels */
- (*ctx->Driver.WriteRGBASpan)( ctx, n, x, y,
- (const GLchan (*)[4]) rgba,
+ (*ctx->Driver.WriteRGBASpan)( ctx, n, x, y,
+ (const GLchan (*)[4]) rgba,
write_all ? Null : mask );
if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_span( ctx, n, x, y,
- (const GLchan (*)[4]) rgba,
+ _mesa_write_alpha_span( ctx, n, x, y,
+ (const GLchan (*)[4]) rgba,
write_all ? Null : mask );
}
}
}
/* write pixels */
- (*ctx->Driver.WriteRGBASpan)( ctx, n, x, y,
- (const GLchan (*)[4]) rgba,
+ (*ctx->Driver.WriteRGBASpan)( ctx, n, x, y,
+ (const GLchan (*)[4]) rgba,
write_all ? Null : mask );
if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_span( ctx, n, x, y,
- (const GLchan (*)[4]) rgba,
+ _mesa_write_alpha_span( ctx, n, x, y,
+ (const GLchan (*)[4]) rgba,
write_all ? Null : mask );
}
}
COPY_CHAN4(rgba[i], color);
}
}
- multi_write_rgba_span( ctx, n, x, y,
+ multi_write_rgba_span( ctx, n, x, y,
(const GLchan (*)[4]) rgba, mask );
}
else {
stipple_polygon_span( ctx, n, x, y, mask );
write_all = GL_FALSE;
}
-
+
/* Texture with alpha test*/
if (ctx->Color.AlphaEnabled) {
/* Texturing without alpha is done after depth-testing which
ASSERT(ctx->Texture._ReallyEnabled);
_swrast_texture_fragments( ctx, 0, n, s, t, u, lambda,
(CONST GLchan (*)[4]) rgba, rgba );
-
+
/* Do the alpha test */
if (_mesa_alpha_test( ctx, n, (const GLchan (*)[4]) rgba, mask ) == 0) {
return;
}
/* Add base and specular colors */
- if (spec &&
+ if (spec &&
(ctx->Fog.ColorSumEnabled ||
(ctx->Light.Enabled && ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)))
add_colors( n, rgba, spec ); /* rgba = rgba + spec */
(*ctx->Driver.WriteRGBASpan)( ctx, n, x, y, (const GLchan (*)[4])rgba,
write_all ? Null : mask );
if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_span( ctx, n, x, y, (const GLchan (*)[4]) rgba,
+ _mesa_write_alpha_span( ctx, n, x, y, (const GLchan (*)[4]) rgba,
write_all ? Null : mask );
}
}
for (i = 0; i < texUnits; i++)
_swrast_texture_fragments( ctx, i, n, s[i], t[i], u[i], lambda[i],
(CONST GLchan (*)[4]) rgbaIn, rgba );
-
+
/* Do the alpha test */
if (_mesa_alpha_test( ctx, n, (const GLchan (*)[4])rgba, mask ) == 0) {
return;
}
/* Add base and specular colors */
- if (spec &&
+ if (spec &&
(ctx->Fog.ColorSumEnabled ||
- (ctx->Light.Enabled &&
+ (ctx->Light.Enabled &&
ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)))
add_colors( n, rgba, spec ); /* rgba = rgba + spec */
-/* $Id: s_span.h,v 1.3 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_span.h,v 1.4 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: s_stencil.c,v 1.9 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_stencil.c,v 1.10 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
/* Stencil Logic:
IF stencil test fails THEN
- Apply fail-op to stencil value
+ Apply fail-op to stencil value
Don't write the pixel (RGBA,Z)
ELSE
IF doing depth test && depth test fails THEN
- Apply zfail-op to stencil value
+ Apply zfail-op to stencil value
Write RGBA and Z to appropriate buffers
ELSE
Apply zpass-op to stencil value
* mask - array [n] of flags (1=stencil and depth test passed)
* Return: GL_TRUE - all fragments failed the testing
* GL_FALSE - one or more fragments passed the testing
- *
+ *
*/
static GLboolean
stencil_and_ztest_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
* Output: mask - array [n] of flags (1=stencil and depth test passed)
* Return: GL_TRUE - all fragments failed the testing
* GL_FALSE - one or more fragments passed the testing
- *
+ *
*/
GLboolean
_mesa_stencil_and_ztest_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
* The comments in this function are a bit sparse but the code is
* almost identical to stencil_and_ztest_span(), which is well
* commented.
- *
+ *
* Input: n - number of pixels in the array
* x, y - array of [n] pixel positions
* z - array [n] of z values
clear_software_stencil_buffer(ctx);
}
}
-
-/* $Id: s_stencil.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_stencil.h,v 1.3 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: s_texture.h,v 1.5 2001/02/20 16:42:26 brianp Exp $ */
+/* $Id: s_texture.h,v 1.6 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
#endif
-
-/* $Id: s_triangle.c,v 1.17 2001/03/08 17:33:33 brianp Exp $ */
+/* $Id: s_triangle.c,v 1.18 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
#include "s_feedback.h"
#include "s_span.h"
#include "s_triangle.h"
-
+
GLboolean _mesa_cull_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
+ const SWvertex *v0,
+ const SWvertex *v1,
const SWvertex *v2 )
{
GLfloat ex = v1->win[0] - v0->win[0];
if (c * SWRAST_CONTEXT(ctx)->_backface_sign > 0)
return 0;
-
+
return 1;
}
* Render a flat-shaded color index triangle.
*/
static void flat_ci_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
+ const SWvertex *v0,
+ const SWvertex *v1,
const SWvertex *v2 )
{
#define INTERP_Z 1
} \
}
-#include "s_tritemp.h"
+#include "s_tritemp.h"
}
* Render a smooth-shaded color index triangle.
*/
static void smooth_ci_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
+ const SWvertex *v0,
+ const SWvertex *v1,
const SWvertex *v2 )
{
#define INTERP_Z 1
* Render an RGB, GL_DECAL, textured triangle.
* Interpolate S,T, GL_LESS depth test, w/out mipmapping or
* perspective correction.
- *
+ *
* No fog.
*/
static void simple_z_textured_triangle( GLcontext *ctx,
tsize = obj->Image[b]->Height * tbytesline;
- /* Instead of defining a function for each mode, a test is done
+ /* Instead of defining a function for each mode, a test is done
* between the outer and inner loops. This is to reduce code size
- * and complexity. Observe that an optimizing compiler kills
+ * and complexity. Observe that an optimizing compiler kills
* unused variables (for instance tf,sf,ti,si in case of GL_NEAREST).
- */
+ */
#define NEAREST_RGB \
tr = tex00[RCOMP]; \
/* The BIAS value is used to shift negative values into positive values.
* Without this, negative texture values don't GL_REPEAT correctly at just
* below zero, because (int)-0.5 = 0 = (int)0.5. We're not going to worry
- * about texture coords less than -BIAS. This could be fixed by using
+ * about texture coords less than -BIAS. This could be fixed by using
* FLOORF etc. instead, but this is slower...
*/
#define BIAS 4096.0F
DRAW_LINE (DO_TEX); \
x_m ++; \
} \
-}
+}
#define SPAN3(DO_TEX, COMP, TEX_COORD) { \
GLfloat x_min = FLOORF (x_tex); \
DRAW_LINE (DO_TEX); \
} \
}
-
+
#define SPAN4(DO_TEX, COMP, TEX_COORD) \
{ \
GLfloat x_min = FLOORF(x_tex); \
static void lambda_textured_triangle1( GLcontext *ctx,
const SWvertex *v0,
const SWvertex *v1,
- const SWvertex *v2,
+ const SWvertex *v2,
GLfloat s[MAX_WIDTH],
GLfloat t[MAX_WIDTH],
GLfloat u[MAX_WIDTH] )
* Interpolate Z, RGB, Alpha, and two sets of texture coordinates.
* Yup, it's slow.
*/
-static void
+static void
lambda_multitextured_triangle1( GLcontext *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2 )
{
GLdepth zspan[MAX_WIDTH];
- GLfixed fogspan[MAX_WIDTH];
+ GLfixed fogspan[MAX_WIDTH];
GLchan rgba[MAX_WIDTH][4], spec[MAX_WIDTH][4];
general_textured_spec_triangle1(ctx,v0,v1,v2,zspan,fogspan,rgba,spec);
}
GLfloat t[MAX_TEXTURE_UNITS][MAX_WIDTH];
DEFMARRAY(GLfloat,u,MAX_TEXTURE_UNITS,MAX_WIDTH);
CHECKARRAY(u,return);
-
+
lambda_multitextured_triangle1(ctx,v0,v1,v2,s,t,u);
-
+
UNDEFARRAY(u);
}
SWRAST_CONTEXT(ctx)->SpecTriangle( ctx, ncv0, ncv1, ncv2 );
COPY_CHAN4( ncv0->color, c[0] );
COPY_CHAN4( ncv1->color, c[1] );
- COPY_CHAN4( ncv2->color, c[2] );
+ COPY_CHAN4( ncv2->color, c[2] );
}
* Please update the summary flag _SWRAST_NEW_TRIANGLE if you add or
* remove tests to this code.
*/
-void
+void
_swrast_choose_triangle( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
ctx->Depth.Func == GL_LESS &&
!ctx->Stencil.Enabled) {
if ((rgbmode &&
- ctx->Color.ColorMask[0] == 0 &&
- ctx->Color.ColorMask[1] == 0 &&
+ ctx->Color.ColorMask[0] == 0 &&
+ ctx->Color.ColorMask[1] == 0 &&
ctx->Color.ColorMask[2] == 0 &&
ctx->Color.ColorMask[3] == 0)
||
&& ctx->Texture.Unit[0].EnvMode!=GL_COMBINE_EXT) {
if (ctx->Hint.PerspectiveCorrection==GL_FASTEST) {
-
+
if (filter==GL_NEAREST
&& format==GL_RGB
&& (ctx->Texture.Unit[0].EnvMode==GL_REPLACE
-/* $Id: s_triangle.h,v 1.6 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_triangle.h,v 1.7 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
void
_swrast_choose_triangle( GLcontext *ctx );
-void
-_swrast_add_spec_terms_triangle( GLcontext *ctx,
+void
+_swrast_add_spec_terms_triangle( GLcontext *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2 );
#endif
-
-/* $Id: s_tritemp.h,v 1.13 2001/03/08 17:33:33 brianp Exp $ */
+/* $Id: s_tritemp.h,v 1.14 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
*
* Optionally, one may provide one-time setup code per triangle:
* SETUP_CODE - code which is to be executed once per triangle
- *
+ *
* The following macro MUST be defined:
* INNER_LOOP(LEFT,RIGHT,Y) - code to write a span of pixels.
* Something like:
* By stepping rasterization parameters along the major edge,
* we can avoid recomputing them at the discontinuity where
* the top and bottom edges meet. However, this forces us to
- * be able to scan both left-to-right and right-to-left.
+ * be able to scan both left-to-right and right-to-left.
* Also, we must determine whether the major edge is at the
* left or right side of the triangle. We do this by
* computing the magnitude of the cross-product of the major
eBot_dt = vMid->texcoord[0][1] * wMid - vMin->texcoord[0][1] * wMin;
dtdx = oneOverArea * (eMaj_dt * eBot.dy - eMaj.dy * eBot_dt);
dtdy = oneOverArea * (eMaj.dx * eBot_dt - eMaj_dt * eBot.dx);
-
+
eMaj_du = vMax->texcoord[0][2] * wMax - vMin->texcoord[0][2] * wMin;
eBot_du = vMid->texcoord[0][2] * wMid - vMin->texcoord[0][2] * wMin;
dudx = oneOverArea * (eMaj_du * eBot.dy - eMaj.dy * eBot_du);
- vMin->texcoord[u][1] * wMin;
dtdx[u] = oneOverArea * (eMaj_dt * eBot.dy - eMaj.dy * eBot_dt);
dtdy[u] = oneOverArea * (eMaj.dx * eBot_dt - eMaj_dt * eBot.dx);
-
+
eMaj_du = vMax->texcoord[u][2] * wMax
- vMin->texcoord[u][2] * wMin;
eBot_du = vMid->texcoord[u][2] * wMid
- vMin->texcoord[u][2] * wMin;
dudx[u] = oneOverArea * (eMaj_du * eBot.dy - eMaj.dy * eBot_du);
dudy[u] = oneOverArea * (eMaj.dx * eBot_du - eMaj_du * eBot.dx);
-
+
eMaj_dv = vMax->texcoord[u][3] * wMax
- vMin->texcoord[u][3] * wMin;
eBot_dv = vMid->texcoord[u][3] * wMid
* inside the triangle.
*
* Next we creep down the major edge until we reach that y,
- * and compute the corresponding x coordinate on the edge.
+ * and compute the corresponding x coordinate on the edge.
* Then we find the half-integral x that lies on or just
* inside the edge. This is the first pixel that might lie in
* the interior of the triangle. (We won't know for sure
GLfloat rho2 = r1 + r2; /* was: rho2 = MAX2(r1,r2); */
lambda_nominator = rho2;
}
-
- /* set DEST to log_(base 2) of sqrt(rho) */
+
+ /* set DEST to log_(base 2) of sqrt(rho) */
/* 1.442695 = 1/log(2) */
#define COMPUTE_LAMBDA(DEST, X) \
DEST = log( lambda_nominator * (X)*(X) ) * 1.442695F * 0.5F
#ifdef INTERP_MULTILAMBDA
/*
- * Read the comment for INTERP_LAMBDA, but apply to each texture unit
+ * Read the comment for INTERP_LAMBDA, but apply to each texture unit
*/
{
GLuint unit;
}
}
}
- /* set DEST to log_(base 2) of sqrt(rho) */
+ /* set DEST to log_(base 2) of sqrt(rho) */
#define COMPUTE_MULTILAMBDA(DEST, X, unit) \
DEST = log( lambda_nominator[unit] * (X)*(X) ) * 1.442695F * 0.5F
#endif
fz += fdzOuter;
#endif
#ifdef INTERP_FOG
- ffog += fdfogOuter;
+ ffog += fdfogOuter;
#endif
#ifdef INTERP_RGB
fr += fdrOuter; fg += fdgOuter; fb += fdbOuter;
-/* $Id: s_zoom.c,v 1.3 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_zoom.c,v 1.4 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
/* write the span */
for (r=r0; r<r1; r++) {
- _mesa_write_rgba_span( ctx, m, x+skipcol, r, zdepth,
+ _mesa_write_rgba_span( ctx, m, x+skipcol, r, zdepth,
(fog ? zfog : 0),
zrgba, GL_BITMAP );
}
/* write the span */
for (r=r0; r<r1; r++) {
- _mesa_write_rgba_span( ctx, m, x+skipcol, r, zdepth,
+ _mesa_write_rgba_span( ctx, m, x+skipcol, r, zdepth,
(fog ? zfog : 0), zrgba, GL_BITMAP );
}
}
/* write the span */
for (r=r0; r<r1; r++) {
- _mesa_write_index_span( ctx, m, x+skipcol, r, zdepth,
+ _mesa_write_index_span( ctx, m, x+skipcol, r, zdepth,
(fog ? zfog : 0), zindexes, GL_BITMAP );
}
}
-/* $Id: s_zoom.h,v 1.3 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_zoom.h,v 1.4 2001/03/12 00:48:42 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
+/* $Id: swrast.h,v 1.11 2001/03/12 00:48:42 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: ss_context.c,v 1.12 2001/03/07 05:06:13 brianp Exp $ */
+/* $Id: ss_context.c,v 1.13 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
#include "swrast_setup.h"
#include "tnl/t_context.h"
-
+
#define _SWSETUP_NEW_VERTS (_NEW_RENDERMODE| \
_NEW_LIGHT| \
_NEW_TEXTURE| \
/* Dispatch from these fixed entrypoints to the state-dependent
- * functions.
+ * functions.
*
* The design of swsetup suggests that we could really program
* ctx->Driver.TriangleFunc directly from _swsetup_RenderStart, and
* avoid this second level of indirection. However, this is more
- * convient for fallback cases in hardware rasterization drivers.
+ * convient for fallback cases in hardware rasterization drivers.
*/
-void
-_swsetup_Quad( GLcontext *ctx, GLuint v0, GLuint v1,
+void
+_swsetup_Quad( GLcontext *ctx, GLuint v0, GLuint v1,
GLuint v2, GLuint v3 )
{
SWSETUP_CONTEXT(ctx)->Quad( ctx, v0, v1, v2, v3 );
}
-void
-_swsetup_Triangle( GLcontext *ctx, GLuint v0, GLuint v1,
+void
+_swsetup_Triangle( GLcontext *ctx, GLuint v0, GLuint v1,
GLuint v2 )
{
SWSETUP_CONTEXT(ctx)->Triangle( ctx, v0, v1, v2 );
}
-void
+void
_swsetup_Line( GLcontext *ctx, GLuint v0, GLuint v1 )
{
SWSETUP_CONTEXT(ctx)->Line( ctx, v0, v1 );
}
-void
+void
_swsetup_Points( GLcontext *ctx, GLuint first, GLuint last )
{
SWSETUP_CONTEXT(ctx)->Points( ctx, first, last );
}
-void
+void
_swsetup_BuildProjectedVertices( GLcontext *ctx, GLuint start, GLuint end,
GLuint new_inputs )
{
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
SScontext *swsetup = (SScontext *)CALLOC(sizeof(SScontext));
-
- if (!swsetup)
+
+ if (!swsetup)
return GL_FALSE;
swsetup->verts = (SWvertex *) ALIGN_MALLOC( sizeof(SWvertex) * tnl->vb.Size, 32);
_swsetup_DestroyContext( GLcontext *ctx )
{
if (SWSETUP_CONTEXT(ctx)) {
- if (SWSETUP_CONTEXT(ctx)->verts)
+ if (SWSETUP_CONTEXT(ctx)->verts)
ALIGN_FREE(SWSETUP_CONTEXT(ctx)->verts);
FREE(SWSETUP_CONTEXT(ctx));
void
_swsetup_RenderStart( GLcontext *ctx )
-{
- SScontext *swsetup = SWSETUP_CONTEXT(ctx);
+{
+ SScontext *swsetup = SWSETUP_CONTEXT(ctx);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLuint new_state = swsetup->NewState;
swsetup->NewState = 0;
- if (VB->ClipMask && VB->importable_data)
+ if (VB->ClipMask && VB->importable_data)
VB->import_data( ctx,
VB->importable_data,
- VEC_NOT_WRITEABLE|VEC_BAD_STRIDE);
+ VEC_NOT_WRITEABLE|VEC_BAD_STRIDE);
}
void
void
_swsetup_InvalidateState( GLcontext *ctx, GLuint new_state )
{
- SScontext *swsetup = SWSETUP_CONTEXT(ctx);
+ SScontext *swsetup = SWSETUP_CONTEXT(ctx);
swsetup->NewState |= new_state;
if (new_state & _SWSETUP_NEW_INTERP) {
}
}
-void
-_swsetup_RenderInterp( GLcontext *ctx, GLfloat t,
+void
+_swsetup_RenderInterp( GLcontext *ctx, GLfloat t,
GLuint dst, GLuint out, GLuint in,
- GLboolean force_boundary )
+ GLboolean force_boundary )
{
SWSETUP_CONTEXT(ctx)->RenderInterp( ctx, t, dst, out, in, force_boundary );
}
-void
-_swsetup_RenderCopyPV( GLcontext *ctx, GLuint dst, GLuint src )
+void
+_swsetup_RenderCopyPV( GLcontext *ctx, GLuint dst, GLuint src )
{
SWSETUP_CONTEXT(ctx)->RenderCopyPV( ctx, dst, src );
}
-
+/* $Id: ss_context.h,v 1.7 2001/03/12 00:48:43 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*/
void (*InvalidateState)( GLcontext *ctx, GLuint new_state );
- void (*BuildProjVerts)( GLcontext *ctx,
+ void (*BuildProjVerts)( GLcontext *ctx,
GLuint start, GLuint end, GLuint new_inputs );
void (*Quad)( GLcontext *ctx, GLuint v0, GLuint v1,
void (*RenderCopyPV)( GLcontext *ctx, GLuint dst, GLuint src );
- void (*RenderInterp)( GLcontext *ctx, GLfloat t,
+ void (*RenderInterp)( GLcontext *ctx, GLfloat t,
GLuint dst, GLuint out, GLuint in,
GLboolean force_boundary );
+/* $Id: ss_triangle.c,v 1.12 2001/03/12 00:48:43 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#include "ss_triangle.h"
#include "ss_context.h"
-#define SS_RGBA_BIT 0x1
-#define SS_OFFSET_BIT 0x2
-#define SS_TWOSIDE_BIT 0x4
-#define SS_UNFILLED_BIT 0x8
+#define SS_RGBA_BIT 0x1
+#define SS_OFFSET_BIT 0x2
+#define SS_TWOSIDE_BIT 0x4
+#define SS_UNFILLED_BIT 0x8
#define SS_MAX_TRIFUNC 0x10
static triangle_func tri_tab[SS_MAX_TRIFUNC];
static quad_func quad_tab[SS_MAX_TRIFUNC];
-static void _swsetup_render_line_tri( GLcontext *ctx,
+static void _swsetup_render_line_tri( GLcontext *ctx,
GLuint e0, GLuint e1, GLuint e2 )
{
- SScontext *swsetup = SWSETUP_CONTEXT(ctx);
+ SScontext *swsetup = SWSETUP_CONTEXT(ctx);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLubyte *ef = VB->EdgeFlag;
SWvertex *verts = swsetup->verts;
}
if (swsetup->render_prim == GL_POLYGON) {
- if (ef[e2]) _swrast_Line( ctx, v2, v0 );
- if (ef[e0]) _swrast_Line( ctx, v0, v1 );
- if (ef[e1]) _swrast_Line( ctx, v1, v2 );
+ if (ef[e2]) _swrast_Line( ctx, v2, v0 );
+ if (ef[e0]) _swrast_Line( ctx, v0, v1 );
+ if (ef[e1]) _swrast_Line( ctx, v1, v2 );
} else {
- if (ef[e0]) _swrast_Line( ctx, v0, v1 );
- if (ef[e1]) _swrast_Line( ctx, v1, v2 );
- if (ef[e2]) _swrast_Line( ctx, v2, v0 );
+ if (ef[e0]) _swrast_Line( ctx, v0, v1 );
+ if (ef[e1]) _swrast_Line( ctx, v1, v2 );
+ if (ef[e2]) _swrast_Line( ctx, v2, v0 );
}
if (ctx->_TriangleCaps & DD_FLATSHADE) {
}
}
-static void _swsetup_render_point_tri( GLcontext *ctx,
+static void _swsetup_render_point_tri( GLcontext *ctx,
GLuint e0, GLuint e1, GLuint e2 )
{
- SScontext *swsetup = SWSETUP_CONTEXT(ctx);
+ SScontext *swsetup = SWSETUP_CONTEXT(ctx);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLubyte *ef = VB->EdgeFlag;
SWvertex *verts = swsetup->verts;
v1->index = v2->index;
}
- if (ef[e0]) _swrast_Point( ctx, v0 );
- if (ef[e1]) _swrast_Point( ctx, v1 );
- if (ef[e2]) _swrast_Point( ctx, v2 );
+ if (ef[e0]) _swrast_Point( ctx, v0 );
+ if (ef[e1]) _swrast_Point( ctx, v1 );
+ if (ef[e2]) _swrast_Point( ctx, v2 );
if (ctx->_TriangleCaps & DD_FLATSHADE) {
COPY_CHAN4(v0->color, c[0]);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts;
GLuint i;
-
+
if (VB->Elts) {
- for (i = first; i < last; i++)
+ for (i = first; i < last; i++)
if (VB->ClipMask[VB->Elts[i]] == 0)
_swrast_Point( ctx, &verts[VB->Elts[i]] );
}
else {
- for (i = first; i < last; i++)
+ for (i = first; i < last; i++)
if (VB->ClipMask[i] == 0)
_swrast_Point( ctx, &verts[i] );
}
swsetup->Line = swsetup_line;
swsetup->Points = swsetup_points;
}
-
+/* $Id: ss_triangle.h,v 1.3 2001/03/12 00:48:43 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
+/* $Id: ss_tritmp.h,v 1.9 2001/03/12 00:48:43 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
if (IND & (SS_TWOSIDE_BIT | SS_UNFILLED_BIT))
{
facing = (cc < 0.0) ^ ctx->Polygon._FrontBit;
-
+
if (IND & SS_UNFILLED_BIT)
mode = facing ? ctx->Polygon.BackMode : ctx->Polygon.FrontMode;
-
+
if (facing == 1) {
if (IND & SS_TWOSIDE_BIT) {
if (IND & SS_RGBA_BIT) {
SS_IND(v[2]->index, vbindex[e2]);
}
}
- }
+ }
}
if (IND & SS_OFFSET_BIT)
v[1]->win[2] += offset;
v[2]->win[2] += offset;
}
- _swrast_Triangle( ctx, v[0], v[1], v[2] );
+ _swrast_Triangle( ctx, v[0], v[1], v[2] );
}
if (IND & SS_OFFSET_BIT) {
v[2]->win[2] = z[2];
}
- if (IND & SS_TWOSIDE_BIT) {
+ if (IND & SS_TWOSIDE_BIT) {
if (facing == 1) {
if (IND & SS_RGBA_BIT) {
GLchan (*vbcolor)[4] = VB->ColorPtr[0]->data;
SS_IND(v[2]->index, vbindex[e2]);
}
}
- }
+ }
}
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLubyte ef1 = VB->EdgeFlag[v1];
GLubyte ef3 = VB->EdgeFlag[v3];
- VB->EdgeFlag[v1] = 0;
+ VB->EdgeFlag[v1] = 0;
TAG(triangle)( ctx, v0, v1, v3 );
VB->EdgeFlag[v1] = ef1;
- VB->EdgeFlag[v3] = 0;
- TAG(triangle)( ctx, v1, v2, v3 );
- VB->EdgeFlag[v3] = ef3;
+ VB->EdgeFlag[v3] = 0;
+ TAG(triangle)( ctx, v1, v2, v3 );
+ VB->EdgeFlag[v3] = ef3;
} else {
TAG(triangle)( ctx, v0, v1, v3 );
TAG(triangle)( ctx, v1, v2, v3 );
#undef IND
#undef TAG
-
-
-
+/* $Id: ss_vb.c,v 1.11 2001/03/12 00:48:43 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
(void) (ctx && start && end && newinputs);
}
-void
+void
_swsetup_vb_init( GLcontext *ctx )
{
GLuint i;
}
-void
+void
_swsetup_choose_rastersetup_func(GLcontext *ctx)
{
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
if (ctx->Visual.rgbMode) {
funcindex = COLOR;
- if (ctx->Texture._ReallyEnabled & ~0xf)
+ if (ctx->Texture._ReallyEnabled & ~0xf)
funcindex |= MULTITEX;
- else if (ctx->Texture._ReallyEnabled & 0xf)
+ else if (ctx->Texture._ReallyEnabled & 0xf)
funcindex |= TEX0;
if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR ||
funcindex |= FOG;
}
else if (ctx->RenderMode == GL_FEEDBACK) {
- if (ctx->Visual.rgbMode)
+ if (ctx->Visual.rgbMode)
funcindex = (COLOR | TEX0); /* is feedback color subject to fogging? */
else
funcindex = (INDEX | TEX0);
- }
+ }
else
funcindex = 0;
swsetup->BuildProjVerts = setup_func[funcindex];
ASSERT(setup_func[funcindex] != rs_invalid);
}
-
+/* $Id: ss_vb.h,v 1.3 2001/03/12 00:48:43 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
+/* $Id: ss_vbtmp.h,v 1.12 2001/03/12 00:48:43 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
(VB->ClipOrMask
? VEC_NOT_WRITEABLE|VEC_BAD_STRIDE
: VEC_BAD_STRIDE));
-
+
if (IND & TEX0) {
tc[0] = VB->TexCoordPtr[0]->data;
tsz[0] = VB->TexCoordPtr[0]->size;
}
-
+
if (IND & MULTITEX) {
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
if (VB->TexCoordPtr[i]) {
VB->SecondaryColorPtr[0] = VB->ColorPtr[0];
VB->SecondaryColorPtr[1] = VB->ColorPtr[1];
}
-
+
proj = VB->ProjectedClipPtr->data;
if (IND & FOG)
- fog = VB->FogCoordPtr->data;
- if (IND & COLOR)
+ fog = VB->FogCoordPtr->data;
+ if (IND & COLOR)
color = VB->ColorPtr[0]->data;
if (IND & SPEC)
spec = VB->SecondaryColorPtr[0]->data;
v->win[1] = sy * proj[i][1] + ty;
v->win[2] = sz * proj[i][2] + tz;
v->win[3] = proj[i][3];
-
- if (IND & TEX0)
+
+ if (IND & TEX0)
COPY_CLEAN_4V( v->texcoord[0], tsz[0], tc[0][i] );
if (IND & MULTITEX) {
GLuint u;
for (u = 0 ; u < maxtex ; u++)
- if (tc[u])
+ if (tc[u])
COPY_CLEAN_4V( v->texcoord[u], tsz[u], tc[u][i] );
}
if (IND & COLOR)
COPY_CHAN4(v->color, color[i]);
-
- if (IND & SPEC)
+
+ if (IND & SPEC)
COPY_CHAN4(v->specular, spec[i]);
if (IND & FOG)
- v->fog = fog[i];
+ v->fog = fog[i];
if (IND & INDEX)
- v->index = index[i];
+ v->index = index[i];
if (IND & POINT)
v->pointSize = pointSize[i];
+/* $Id: swrast_setup.h,v 1.8 2001/03/12 00:48:43 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
#ifndef SWRAST_SETUP_H
#define SWRAST_SETUP_H
-extern GLboolean
+extern GLboolean
_swsetup_CreateContext( GLcontext *ctx );
-extern void
+extern void
_swsetup_DestroyContext( GLcontext *ctx );
-extern void
+extern void
_swsetup_InvalidateState( GLcontext *ctx, GLuint new_state );
-extern void
-_swsetup_BuildProjectedVertices( GLcontext *ctx,
- GLuint start,
+extern void
+_swsetup_BuildProjectedVertices( GLcontext *ctx,
+ GLuint start,
GLuint end,
GLuint new_inputs );
-extern void
+extern void
_swsetup_Quad( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3 );
-extern void
+extern void
_swsetup_Triangle( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2 );
-extern void
+extern void
_swsetup_Line( GLcontext *ctx, GLuint v0, GLuint v1 );
-extern void
+extern void
_swsetup_Points( GLcontext *ctx, GLuint first, GLuint last );
extern void
extern void
_swsetup_RenderFinish( GLcontext *ctx );
-extern void
+extern void
_swsetup_RenderProjectInterpVerts( GLcontext *ctx );
-extern void
-_swsetup_RenderInterp( GLcontext *ctx, GLfloat t,
+extern void
+_swsetup_RenderInterp( GLcontext *ctx, GLfloat t,
GLuint dst, GLuint out, GLuint in,
GLboolean force_boundary );
-extern void
+extern void
_swsetup_RenderCopyPV( GLcontext *ctx, GLuint dst, GLuint src );
-extern void
+extern void
_swsetup_RenderClippedPolygon( GLcontext *ctx, const GLuint *elts, GLuint n );
-extern void
+extern void
_swsetup_RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj );
-/* $Id: t_array_api.c,v 1.9 2001/03/07 05:06:13 brianp Exp $ */
+/* $Id: t_array_api.c,v 1.10 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
#else
/* Simple alternative to above code.
*/
- if (_tnl_hard_begin( ctx, mode ))
+ if (_tnl_hard_begin( ctx, mode ))
{
GLuint i;
for (i=start;i<count;i++) {
}
-static void _tnl_draw_elements( GLcontext *ctx, GLenum mode, GLsizei count,
+static void _tnl_draw_elements( GLcontext *ctx, GLenum mode, GLsizei count,
const GLuint *indices)
{
#if 1
}
-static void _tnl_draw_range_elements( GLcontext *ctx, GLenum mode,
- GLuint start, GLuint end,
+static void _tnl_draw_range_elements( GLcontext *ctx, GLenum mode,
+ GLuint start, GLuint end,
GLsizei count, const GLuint *indices )
-
+
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
FLUSH_CURRENT( ctx, 0 );
tnl->vb.PrimitiveLength[0] = count;
tnl->vb.Elts = (GLuint *)indices;
- if (ctx->Array.LockCount)
+ if (ctx->Array.LockCount)
_tnl_run_pipeline( ctx );
else {
/* Note that arrays may have changed before/after execution.
/* The arrays are small enough to fit in a single VB; just bind
* them and go. Any untransformed data will be copied on
* clipping.
- *
+ *
* Invalidate any locked data dependent on these arrays.
*/
_tnl_vb_bind_arrays( ctx, start, count );
VB->FirstPrimitive = 0;
VB->Primitive[0] = mode | PRIM_BEGIN | PRIM_END | PRIM_LAST;
- VB->PrimitiveLength[0] = count - start;
+ VB->PrimitiveLength[0] = count - start;
tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
_tnl_run_pipeline( ctx );
tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
}
- }
+ }
else if (!ctx->CompileFlag && mode == GL_TRIANGLE_STRIP) {
int bufsz = (ctx->Const.MaxArrayLockSize - 2) & ~1;
int j, nr;
nr = MIN2( bufsz, count - j );
_tnl_vb_bind_arrays( ctx, j, j + nr );
VB->FirstPrimitive = 0;
- VB->Primitive[0] = mode | PRIM_BEGIN | PRIM_END | PRIM_LAST;
- VB->PrimitiveLength[0] = nr;
+ VB->Primitive[0] = mode | PRIM_BEGIN | PRIM_END | PRIM_LAST;
+ VB->PrimitiveLength[0] = nr;
tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
_tnl_run_pipeline( ctx );
tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
/* Check arguments, etc.
*/
- if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
+ if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
type, indices ))
return;
if (tnl->pipeline.build_state_changes)
_tnl_validate_pipeline( ctx );
- ui_indices = (GLuint *)_ac_import_elements( ctx, GL_UNSIGNED_INT,
+ ui_indices = (GLuint *)_ac_import_elements( ctx, GL_UNSIGNED_INT,
count, type, indices );
-
+
if (ctx->Array.LockCount) {
/* Are the arrays already locked? If so we currently have to look
* at the whole locked range.
*/
if (start >= ctx->Array.LockFirst && end <= ctx->Array.LockCount)
- _tnl_draw_range_elements( ctx, mode,
- ctx->Array.LockFirst,
+ _tnl_draw_range_elements( ctx, mode,
+ ctx->Array.LockFirst,
ctx->Array.LockCount,
count, ui_indices );
else {
/* The spec says referencing elements outside the locked
* range is undefined. I'm going to make it a noop this time
- * round, maybe come up with something beter before 3.6.
+ * round, maybe come up with something beter before 3.6.
*
* May be able to get away with just setting LockCount==0,
* though this raises the problems of dependent state. May
*
* Or scan the list and replace bad indices?
*/
- _mesa_problem( ctx,
+ _mesa_problem( ctx,
"DrawRangeElements references "
"elements outside locked range.");
}
void
-_tnl_DrawElements(GLenum mode, GLsizei count, GLenum type,
+_tnl_DrawElements(GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices)
{
GET_CURRENT_CONTEXT(ctx);
if (tnl->pipeline.build_state_changes)
_tnl_validate_pipeline( ctx );
- ui_indices = (GLuint *)_ac_import_elements( ctx, GL_UNSIGNED_INT,
+ ui_indices = (GLuint *)_ac_import_elements( ctx, GL_UNSIGNED_INT,
count, type, indices );
if (ctx->Array.LockCount) {
- _tnl_draw_range_elements( ctx, mode,
+ _tnl_draw_range_elements( ctx, mode,
ctx->Array.LockFirst,
ctx->Array.LockCount,
count, ui_indices );
- }
+ }
else {
/* Scan the index list and see if we can use the locked path anyway.
*/
GLuint max_elt = 0;
GLint i;
- for (i = 0 ; i < count ; i++)
+ for (i = 0 ; i < count ; i++)
if (ui_indices[i] > max_elt)
max_elt = ui_indices[i];
_mesa_vector1ui_init( &tmp->Index, 0, 0 );
_mesa_vector1ub_init( &tmp->EdgeFlag, 0, 0 );
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
_mesa_vector4f_init( &tmp->TexCoord[i], 0, 0);
tnl->tmp_primitive = (GLuint *)MALLOC(sizeof(GLuint)*tnl->vb.Size);
-/* $Id: t_array_api.h,v 1.1 2000/12/26 05:09:32 keithw Exp $ */
+/* $Id: t_array_api.h,v 1.2 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: t_array_import.c,v 1.10 2001/03/07 05:06:13 brianp Exp $ */
+/* $Id: t_array_import.c,v 1.11 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
GLboolean is_writeable = 0;
struct vertex_arrays *inputs = &TNL_CONTEXT(ctx)->array_inputs;
- tmp = _ac_import_vertex(ctx,
+ tmp = _ac_import_vertex(ctx,
GL_FLOAT,
stride ? 4*sizeof(GLfloat) : 0,
0,
- writeable,
+ writeable,
&is_writeable);
-
+
inputs->Obj.data = (GLfloat (*)[4]) tmp->Ptr;
inputs->Obj.start = (GLfloat *) tmp->Ptr;
inputs->Obj.stride = tmp->StrideB;
GLboolean is_writeable = 0;
struct vertex_arrays *inputs = &TNL_CONTEXT(ctx)->array_inputs;
- tmp = _ac_import_normal(ctx, GL_FLOAT,
- stride ? 3*sizeof(GLfloat) : 0, writeable,
+ tmp = _ac_import_normal(ctx, GL_FLOAT,
+ stride ? 3*sizeof(GLfloat) : 0, writeable,
&is_writeable);
-
+
inputs->Normal.data = (GLfloat (*)[3]) tmp->Ptr;
inputs->Normal.start = (GLfloat *) tmp->Ptr;
inputs->Normal.stride = tmp->StrideB;
GLboolean is_writeable = 0;
struct vertex_arrays *inputs = &TNL_CONTEXT(ctx)->array_inputs;
- tmp = _ac_import_color(ctx,
- GL_UNSIGNED_BYTE,
- stride ? 4*sizeof(GLubyte) : 0,
+ tmp = _ac_import_color(ctx,
+ GL_UNSIGNED_BYTE,
+ stride ? 4*sizeof(GLubyte) : 0,
4,
- writeable,
+ writeable,
&is_writeable);
-
+
inputs->Color.data = (GLchan (*)[4]) tmp->Ptr;
inputs->Color.start = (GLchan *) tmp->Ptr;
inputs->Color.stride = tmp->StrideB;
GLboolean is_writeable = 0;
struct vertex_arrays *inputs = &TNL_CONTEXT(ctx)->array_inputs;
- tmp = _ac_import_secondarycolor(ctx, GL_UNSIGNED_BYTE,
- stride ? 4*sizeof(GLubyte) : 0,
+ tmp = _ac_import_secondarycolor(ctx, GL_UNSIGNED_BYTE,
+ stride ? 4*sizeof(GLubyte) : 0,
4,
- writeable,
+ writeable,
&is_writeable);
-
+
inputs->SecondaryColor.data = (GLchan (*)[4]) tmp->Ptr;
inputs->SecondaryColor.start = (GLchan *) tmp->Ptr;
inputs->SecondaryColor.stride = tmp->StrideB;
struct gl_client_array *tmp;
GLboolean is_writeable = 0;
- tmp = _ac_import_fogcoord(ctx, GL_FLOAT,
- stride ? sizeof(GLfloat) : 0, writeable,
+ tmp = _ac_import_fogcoord(ctx, GL_FLOAT,
+ stride ? sizeof(GLfloat) : 0, writeable,
&is_writeable);
-
+
inputs->FogCoord.data = (GLfloat *) tmp->Ptr;
inputs->FogCoord.start = (GLfloat *) tmp->Ptr;
inputs->FogCoord.stride = tmp->StrideB;
struct gl_client_array *tmp;
GLboolean is_writeable = 0;
- tmp = _ac_import_index(ctx, GL_UNSIGNED_INT,
- stride ? sizeof(GLuint) : 0, writeable,
+ tmp = _ac_import_index(ctx, GL_UNSIGNED_INT,
+ stride ? sizeof(GLuint) : 0, writeable,
&is_writeable);
-
+
inputs->Index.data = (GLuint *) tmp->Ptr;
inputs->Index.start = (GLuint *) tmp->Ptr;
inputs->Index.stride = tmp->StrideB;
inputs->Index.flags |= VEC_NOT_WRITEABLE;
}
-
+
static void _tnl_import_texcoord( GLcontext *ctx,
GLuint i,
GLboolean writeable,
struct gl_client_array *tmp;
GLboolean is_writeable = 0;
- tmp = _ac_import_texcoord(ctx, i, GL_FLOAT,
- stride ? 4*sizeof(GLfloat) : 0,
+ tmp = _ac_import_texcoord(ctx, i, GL_FLOAT,
+ stride ? 4*sizeof(GLfloat) : 0,
0,
- writeable,
+ writeable,
&is_writeable);
-
+
inputs->TexCoord[i].data = (GLfloat (*)[4]) tmp->Ptr;
inputs->TexCoord[i].start = (GLfloat *) tmp->Ptr;
inputs->TexCoord[i].stride = tmp->StrideB;
if (!is_writeable)
inputs->TexCoord[i].flags |= VEC_NOT_WRITEABLE;
}
-
-
+
+
static void _tnl_import_edgeflag( GLcontext *ctx,
GLboolean writeable,
GLboolean stride )
struct gl_client_array *tmp;
GLboolean is_writeable = 0;
- tmp = _ac_import_edgeflag(ctx, GL_UNSIGNED_BYTE,
- stride ? sizeof(GLubyte) : 0,
- 0,
+ tmp = _ac_import_edgeflag(ctx, GL_UNSIGNED_BYTE,
+ stride ? sizeof(GLubyte) : 0,
+ 0,
&is_writeable);
-
+
inputs->EdgeFlag.data = (GLubyte *) tmp->Ptr;
inputs->EdgeFlag.start = (GLubyte *) tmp->Ptr;
inputs->EdgeFlag.stride = tmp->StrideB;
struct vertex_arrays *inputs = &TNL_CONTEXT(ctx)->array_inputs;
(void) inputs;
- if ((required & VERT_CLIP) && VB->ClipPtr == VB->ObjPtr)
+ if ((required & VERT_CLIP) && VB->ClipPtr == VB->ObjPtr)
required |= VERT_OBJ;
/* _tnl_print_vert_flags("_tnl_upgrade_client_data", required); */
}
if (required & VERT_TEX_ANY)
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if ((required & VERT_TEX(i)) && (VB->TexCoordPtr[i]->flags & flags)) {
ASSERT(VB->TexCoordPtr[i] == &inputs->TexCoord[i]);
_tnl_import_texcoord( ctx, i, writeable, stride );
VB->importable_data &= ~VERT_TEX(i);
}
-
+
}
ASSERT(start == (GLint) ctx->Array.LockFirst);
ASSERT(count == (GLint) ctx->Array.LockCount);
}
-
+
imports = tnl->pipeline.inputs;
_ac_import_range( ctx, start, count );
-
+
VB->Count = count - start;
VB->FirstClipped = VB->Count;
VB->MaterialMask = 0;
VB->Material = 0;
VB->Flag = 0;
-
+
/* _tnl_print_vert_flags("_tnl_vb_bind_arrays: inputs", inputs); */
/* _tnl_print_vert_flags("_tnl_vb_bind_arrays: imports", imports); */
/* _tnl_print_vert_flags("_tnl_vb_bind_arrays: _Enabled", ctx->Array._Enabled); */
if (inputs & VERT_OBJ) {
if (imports & VERT_OBJ) {
- _tnl_import_vertex( ctx, 0, 0 );
+ _tnl_import_vertex( ctx, 0, 0 );
tmp->Obj.count = VB->Count;
}
VB->ObjPtr = &tmp->Obj;
if (inputs & VERT_NORM) {
if (imports & VERT_NORM) {
- _tnl_import_normal( ctx, 0, 0 );
+ _tnl_import_normal( ctx, 0, 0 );
tmp->Normal.count = VB->Count;
}
VB->NormalPtr = &tmp->Normal;
if (inputs & VERT_RGBA) {
if (imports & VERT_RGBA) {
- _tnl_import_color( ctx, 0, 0 );
+ _tnl_import_color( ctx, 0, 0 );
tmp->Color.count = VB->Count;
}
VB->ColorPtr[0] = &tmp->Color;
if (inputs & VERT_INDEX) {
if (imports & VERT_INDEX) {
- _tnl_import_index( ctx, 0, 0 );
+ _tnl_import_index( ctx, 0, 0 );
tmp->Index.count = VB->Count;
}
VB->IndexPtr[0] = &tmp->Index;
VB->IndexPtr[1] = 0;
- }
+ }
if (inputs & VERT_FOG_COORD) {
if (imports & VERT_FOG_COORD) {
- _tnl_import_fogcoord( ctx, 0, 0 );
+ _tnl_import_fogcoord( ctx, 0, 0 );
tmp->FogCoord.count = VB->Count;
}
VB->FogCoordPtr = &tmp->FogCoord;
}
-
+
if (inputs & VERT_EDGE) {
- _tnl_import_edgeflag( ctx, GL_TRUE, sizeof(GLboolean) );
+ _tnl_import_edgeflag( ctx, GL_TRUE, sizeof(GLboolean) );
VB->EdgeFlag = (GLboolean *) tmp->EdgeFlag.data;
}
-
+
if (inputs & VERT_SPEC_RGB) {
if (imports & VERT_SPEC_RGB) {
- _tnl_import_secondarycolor( ctx, 0, 0 );
+ _tnl_import_secondarycolor( ctx, 0, 0 );
tmp->SecondaryColor.count = VB->Count;
}
VB->SecondaryColorPtr[0] = &tmp->SecondaryColor;
VB->SecondaryColorPtr[1] = 0;
}
-
+
if (inputs & VERT_TEX_ANY) {
GLuint i;
for (i = 0; i < ctx->Const.MaxTextureUnits ; i++)
if (inputs & VERT_TEX(i)) {
if (imports & VERT_TEX(i)) {
- _tnl_import_texcoord( ctx, i, 0, 0 );
+ _tnl_import_texcoord( ctx, i, 0, 0 );
tmp->TexCoord[i].count = VB->Count;
}
VB->TexCoordPtr[i] = &tmp->TexCoord[i];
VB->import_data = _tnl_upgrade_client_data;
VB->importable_data = imports & VERT_FIXUP;
/* _tnl_print_vert_flags("_tnl_vb_bind_arrays: importable", VB->importable_data); */
-
+
}
* consecutive calls to ArrayElement with consecutive indices.
*/
void _tnl_fill_immediate_drawarrays( GLcontext *ctx, struct immediate *IM,
- GLuint start, GLuint count )
+ GLuint start, GLuint count )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint required = ctx->Array._Enabled;
else if (ctx->Array.Vertex.Size == 3)
required |= VERT_OBJ_23;
-
+
if (required & VERT_NORM) {
_math_trans_3f( IM->Normal + IM->Start,
ctx->Array.Normal.Ptr,
ctx->Array.Normal.Type,
start, n );
}
-
+
if (required & VERT_EDGE) {
_math_trans_1ub( IM->EdgeFlag + IM->Start,
ctx->Array.EdgeFlag.Ptr,
ctx->Array.EdgeFlag.Type,
start, n );
}
-
+
if (required & VERT_RGBA) {
_math_trans_4chan( IM->Color + IM->Start,
- ctx->Array.Color.Ptr,
+ ctx->Array.Color.Ptr,
ctx->Array.Color.StrideB,
ctx->Array.Color.Type,
ctx->Array.Color.Size,
if (required & VERT_SPEC_RGB) {
_math_trans_4chan( IM->SecondaryColor + IM->Start,
ctx->Array.SecondaryColor.Ptr,
- ctx->Array.SecondaryColor.StrideB,
- ctx->Array.SecondaryColor.Type,
- ctx->Array.SecondaryColor.Size,
+ ctx->Array.SecondaryColor.StrideB,
+ ctx->Array.SecondaryColor.Type,
+ ctx->Array.SecondaryColor.Size,
start, n );
}
if (required & VERT_FOG_COORD) {
_math_trans_1f( IM->FogCoord + IM->Start,
- ctx->Array.FogCoord.Ptr,
+ ctx->Array.FogCoord.Ptr,
ctx->Array.FogCoord.StrideB,
ctx->Array.FogCoord.Type,
start, n );
}
-
+
if (required & VERT_INDEX) {
_math_trans_1ui( IM->Index + IM->Start,
- ctx->Array.Index.Ptr,
- ctx->Array.Index.StrideB,
- ctx->Array.Index.Type,
+ ctx->Array.Index.Ptr,
+ ctx->Array.Index.StrideB,
+ ctx->Array.Index.Type,
start, n );
}
-
+
if (required & VERT_TEX_ANY) {
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
if (required & VERT_TEX(i)) {
if (ctx->Array.TexCoord[i].Size == 4)
IM->TexSize |= TEX_SIZE_4(i);
else if (ctx->Array.TexCoord[i].Size == 3)
- IM->TexSize |= TEX_SIZE_3(i);
+ IM->TexSize |= TEX_SIZE_3(i);
}
}
}
-
+
IM->Count = IM->Start + n;
IM->Flag[IM->Start] |= required;
- for (i = IM->Start+1 ; i < IM->Count ; i++)
+ for (i = IM->Start+1 ; i < IM->Count ; i++)
IM->Flag[i] = required;
}
-
-
-/* $Id: t_array_import.h,v 1.1 2000/12/26 05:09:32 keithw Exp $ */
+/* $Id: t_array_import.h,v 1.2 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: t_context.c,v 1.14 2001/03/11 23:49:20 gareth Exp $ */
+/* $Id: t_context.c,v 1.15 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keithw@valinux.com>
*/
-/* $Id: t_context.h,v 1.16 2001/03/07 05:06:13 brianp Exp $ */
+/* $Id: t_context.h,v 1.17 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#define IMM_SIZE (IMM_MAXDATA + MAX_CLIPPED_VERTICES)
-/* Values for IM->BeginState
+/* Values for IM->BeginState
*/
#define VERT_BEGIN_0 0x1 /* glBegin (if initially inside beg/end) */
#define VERT_BEGIN_1 0x2 /* glBegin (if initially outside beg/end) */
/* Flags that describe the inputs and outputs of pipeline stages, and
- * the contents of a vertex-cassette.
+ * the contents of a vertex-cassette.
*
* 5 spare flags, rearrangement of eval flags can secure at least 3
- * more.
+ * more.
*/
-#define VERT_OBJ _NEW_ARRAY_VERTEX
-#define VERT_RGBA _NEW_ARRAY_COLOR
-#define VERT_NORM _NEW_ARRAY_NORMAL
-#define VERT_INDEX _NEW_ARRAY_INDEX
-#define VERT_EDGE _NEW_ARRAY_EDGEFLAG
+#define VERT_OBJ _NEW_ARRAY_VERTEX
+#define VERT_RGBA _NEW_ARRAY_COLOR
+#define VERT_NORM _NEW_ARRAY_NORMAL
+#define VERT_INDEX _NEW_ARRAY_INDEX
+#define VERT_EDGE _NEW_ARRAY_EDGEFLAG
#define VERT_SPEC_RGB _NEW_ARRAY_SECONDARYCOLOR
#define VERT_FOG_COORD _NEW_ARRAY_FOGCOORD
#define VERT_TEX0 _NEW_ARRAY_TEXCOORD_0
*/
struct immediate
{
- struct __GLcontextRec *backref;
+ struct __GLcontextRec *backref;
GLuint id, ref_count;
/* This must be saved when immediates are shared in display lists.
GLuint AndFlag, OrFlag;
GLuint TexSize; /* keep track of texcoord sizes */
GLuint BeginState, SavedBeginState;
- GLuint LastPrimitive;
+ GLuint LastPrimitive;
GLuint ArrayEltFlags; /* precalc'ed for glArrayElt */
GLuint ArrayEltIncr;
GLuint MaxTextureUnits; /* precalc'ed for glMultiTexCoordARB */
- /* Temporary values created when vertices are copied into the
+ /* Temporary values created when vertices are copied into the
* first 3 slots of the struct:
*/
GLuint CopyOrFlag;
GLuint Primitive[IMM_SIZE]; /* BEGIN/END */
GLuint PrimitiveLength[IMM_SIZE]; /* BEGIN/END */
GLuint Flag[IMM_SIZE]; /* VERT_* flags */
- GLchan Color[IMM_SIZE][4];
- GLfloat Obj[IMM_SIZE][4];
+ GLchan Color[IMM_SIZE][4];
+ GLfloat Obj[IMM_SIZE][4];
GLfloat Normal[IMM_SIZE][3];
GLfloat TexCoord0[IMM_SIZE][4]; /* just VERT_TEX0 */
GLuint Elt[IMM_SIZE];
GLuint *Primitive; /* GL_(mode)|PRIM_* flags */
GLuint *PrimitiveLength; /* integers */
-
+
GLuint importable_data;
void (*import_data)( GLcontext *ctx, GLuint flags, GLuint vecflags );
/* Callback to the provider of the untransformed input for the
* render stage (or other stages) to call if they need to write into
* write-protected arrays, or fixup the stride on input arrays.
- *
+ *
* This is currently only necessary for client arrays that make it
* as far down the pipeline as the render stage.
*/
GLuint LastClipped;
/* Private data from _tnl_render_stage that has no business being
- * in this struct.
+ * in this struct.
*/
} TNLvertexbuffer;
-/* Describes an individual operation on the pipeline.
+/* Describes an individual operation on the pipeline.
*/
struct gl_pipeline_stage {
const char *name;
*/
GLuint run_state; /* All state referenced in run() --
* When is the cached output of the
- * stage invalidated?
+ * stage invalidated?
*/
-
+
GLboolean active; /* True if runnable in current state */
GLuint inputs; /* VERT_* inputs to the stage */
GLuint outputs; /* VERT_* outputs of the stage */
*/
GLuint changed_inputs; /* Generated value -- inputs to the
* stage that have changed since last
- * call to 'run'.
+ * call to 'run'.
*/
/* Private data for the pipeline stage:
void (*destroy)( struct gl_pipeline_stage * );
/* Called from _tnl_validate_pipeline(). Must update all fields in
- * the pipeline_stage struct for the current state.
+ * the pipeline_stage struct for the current state.
*/
void (*check)( GLcontext *ctx, struct gl_pipeline_stage * );
/* Called from _tnl_run_pipeline(). The stage.changed_inputs value
* encodes all inputs to thee struct which have changed. If
* non-zero, recompute all affected outputs of the stage, otherwise
- * execute any 'sideeffects' of the stage.
+ * execute any 'sideeffects' of the stage.
*
* Return value: GL_TRUE - keep going
* GL_FALSE - finished pipeline
GLuint EvalMap2Flags;
GLuint EvalNewState;
- GLfloat Coord[IMM_SIZE][4];
- GLfloat Obj[IMM_SIZE][4];
- GLfloat TexCoord[IMM_SIZE][4];
+ GLfloat Coord[IMM_SIZE][4];
+ GLfloat Obj[IMM_SIZE][4];
+ GLfloat TexCoord[IMM_SIZE][4];
GLfloat Normal[IMM_SIZE][3];
- GLchan Color[IMM_SIZE][4];
+ GLchan Color[IMM_SIZE][4];
GLuint Index[IMM_SIZE];
GLuint Flag[IMM_SIZE];
GLuint Elts[IMM_SIZE];
};
-typedef struct {
+typedef struct {
/* Track whether the module is active.
*/
/* Set when executing an internally generated immediate.
*/
- GLboolean ReplayHardBeginEnd;
+ GLboolean ReplayHardBeginEnd;
GLenum CurrentPrimitive;
/* Note which vertices need copying over succesive immediates.
* Will add save versions to precompute vertex copying where
* possible.
*/
- struct immediate *ExecCopySource;
+ struct immediate *ExecCopySource;
GLuint ExecCopyCount;
GLuint ExecCopyElts[IMM_MAX_COPIED_VERTS];
GLuint ExecCopyTexSize;
-/* $Id: t_eval_api.c,v 1.3 2001/03/03 20:33:31 brianp Exp $ */
+/* $Id: t_eval_api.c,v 1.4 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* Thus we need to have a check in the display list code or
* elsewhere for eval(1,2) vertices in the case where
* map(1,2)_vertex is disabled, and to purge those vertices from
- * the vb.
+ * the vb.
*/
void
_tnl_exec_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
/* Need to turn off compilation -- this is already saved, and the
* coordinates generated and the test above depend on state that
- * may change before the list is executed.
- *
+ * may change before the list is executed.
+ *
* TODO: Anaylse display lists to determine if this state is
* constant.
*/
/* Need to turn off compilation -- this is already saved, and the
* coordinates generated and the test above depend on state that
- * may change before the list is executed.
+ * may change before the list is executed.
*/
{
GLboolean compiling = ctx->CompileFlag;
-/* $Id: t_eval_api.h,v 1.1 2000/12/26 05:09:32 keithw Exp $ */
+/* $Id: t_eval_api.h,v 1.2 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*/
extern void _tnl_exec_EvalMesh1( GLenum mode, GLint i1, GLint i2 );
-extern void _tnl_exec_EvalMesh2( GLenum mode, GLint i1, GLint i2,
+extern void _tnl_exec_EvalMesh2( GLenum mode, GLint i1, GLint i2,
GLint j1, GLint j2 );
void _tnl_eval_init( GLcontext *ctx );
-/* $Id: t_imm_alloc.c,v 1.4 2001/03/07 05:06:13 brianp Exp $ */
+/* $Id: t_imm_alloc.c,v 1.5 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
IM->FlushElt = 0;
IM->LastPrimitive = IMM_MAX_COPIED_VERTS;
IM->Count = IMM_MAX_COPIED_VERTS;
- IM->Start = IMM_MAX_COPIED_VERTS;
+ IM->Start = IMM_MAX_COPIED_VERTS;
IM->Material = 0;
IM->MaterialMask = 0;
IM->MaxTextureUnits = ctx->Const.MaxTextureUnits;
IM->MaterialMask = 0;
}
- for (j = 1; j < IM->MaxTextureUnits; j++)
+ for (j = 1; j < IM->MaxTextureUnits; j++)
ALIGN_FREE( IM->TexCoord[j] );
freed++;
/* printf("outstanding %d\n", id - freed); */
}
-
-
-
-/* $Id: t_imm_alloc.h,v 1.1 2000/12/26 05:09:32 keithw Exp $ */
+/* $Id: t_imm_alloc.h,v 1.2 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
+/* $Id: t_imm_api.c,v 1.8 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
- * Keith Whitwell <keith@precisioninsight.com>
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
*/
#include "t_imm_dlist.h"
-/* A cassette is full or flushed on a statechange.
+/* A cassette is full or flushed on a statechange.
*/
void _tnl_flush_immediate( struct immediate *IM )
{
GLcontext *ctx = IM->backref;
- if (ctx->CompileFlag)
+ if (ctx->CompileFlag)
_tnl_compile_cassette( ctx, IM );
- else
+ else
_tnl_execute_cassette( ctx, IM );
}
if (MESA_VERBOSE&VERBOSE_API)
fprintf(stderr, "glBegin(IM %d) %s\n", IM->id, _mesa_lookup_enum_by_nr(p));
-
+
if (ctx->NewState)
_mesa_update_state(ctx);
-
+
/* if only a very few slots left, might as well flush now
*/
- if (IM->Count > IMM_MAXDATA-8) {
+ if (IM->Count > IMM_MAXDATA-8) {
_tnl_flush_immediate( IM );
IM = TNL_CURRENT_IM(ctx);
}
ASSERT(IM->Primitive[IM->LastPrimitive] & PRIM_LAST);
state |= (VERT_BEGIN_0|VERT_BEGIN_1);
- IM->Flag[count] |= VERT_BEGIN;
+ IM->Flag[count] |= VERT_BEGIN;
IM->Primitive[IM->LastPrimitive] &= ~PRIM_LAST;
IM->Primitive[count] = p | PRIM_BEGIN | PRIM_LAST;
IM->PrimitiveLength[IM->LastPrimitive] = count - IM->LastPrimitive;
if (mode > GL_POLYGON) {
_mesa_compile_error( ctx, GL_INVALID_ENUM, "glBegin" );
- return;
+ return;
}
_tnl_begin(ctx, mode);
- /* If compiling update SavePrimitive now.
+ /* If compiling update SavePrimitive now.
*
* In compile_and_exec mode, exec_primitive will be updated when
* the cassette is finished.
* If not compiling, update exec_primitive now.
*/
if (ctx->CompileFlag) {
- if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN)
+ if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN)
ctx->Driver.CurrentSavePrimitive = PRIM_INSIDE_UNKNOWN_PRIM;
else if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END)
- ctx->Driver.CurrentSavePrimitive = mode;
+ ctx->Driver.CurrentSavePrimitive = mode;
}
else if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END)
ctx->Driver.CurrentExecPrimitive = mode;
{
struct immediate *IM = TNL_CURRENT_IM(ctx);
GLuint count, last;
-
+
if (ctx->NewState)
_mesa_update_state(ctx);
-
+
/* If not compiling, treat as a normal begin().
*/
if (!ctx->CompileFlag) {
ctx->Driver.CurrentExecPrimitive = p;
return GL_TRUE;
}
-
- if (IM->Count > IMM_MAXDATA-8) {
+
+ if (IM->Count > IMM_MAXDATA-8) {
_tnl_flush_immediate( IM );
IM = TNL_CURRENT_IM(ctx);
}
-
+
switch (IM->BeginState & (VERT_BEGIN_0|VERT_BEGIN_1)) {
case VERT_BEGIN_0|VERT_BEGIN_1:
/* This is an immediate known to be inside a begin/end object.
*/
IM->BeginState |= (VERT_ERROR_1|VERT_ERROR_0);
return GL_FALSE;
-
+
case VERT_BEGIN_0:
case VERT_BEGIN_1:
/* This is a display-list immediate in an unknown begin/end
- * state. Assert it is empty and conviert it to a 'hard' one.
+ * state. Assert it is empty and conviert it to a 'hard' one.
*/
ASSERT (IM->SavedBeginState == 0);
-
+
/* ASSERT (ctx->Driver.CurrentSavePrimitive >= GL_POLYGON+1); */
/* Push current beginstate, to be restored later. Don't worry
* about raising errors.
*/
IM->SavedBeginState = IM->BeginState;
-
+
/* FALLTHROUGH */
- case 0:
- /* Unless we have fallen through, this is an immediate known to
+ case 0:
+ /* Unless we have fallen through, this is an immediate known to
* be outside begin/end objects.
*/
-
+
IM->BeginState |= VERT_BEGIN_0|VERT_BEGIN_1;
-
+
count = IM->Count;
last = IM->LastPrimitive;
ASSERT(IM->Primitive[IM->LastPrimitive] & PRIM_LAST);
- IM->Flag[count] |= VERT_BEGIN;
+ IM->Flag[count] |= VERT_BEGIN;
IM->Primitive[last] &= ~PRIM_LAST;
IM->Primitive[count] = p | PRIM_BEGIN | PRIM_LAST;
IM->PrimitiveLength[last] = count - last;
IM->LastPrimitive = count;
-
+
ASSERT (!IM->FlushElt);
/* This is necessary as this immediate will not be flushed in
ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
return GL_TRUE;
-
+
default:
ASSERT (0);
- return GL_TRUE;
+ return GL_TRUE;
}
}
/* Need to do this to get the correct begin/end error behaviour from
* functions like ColorPointerEXT which are still active in
- * SAVE_AND_EXEC modes.
+ * SAVE_AND_EXEC modes.
*/
void
_tnl_save_Begin( GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
-
+
if (mode > GL_POLYGON) {
_mesa_compile_error( ctx, GL_INVALID_ENUM, "glBegin" );
- return;
+ return;
}
if (ctx->ExecuteFlag) {
_tnl_translate_array_elts( ctx, IM, last, count );
IM->FlushElt = 0;
}
-
+
/* ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; */
}
- IM->BeginState = state;
+ IM->BeginState = state;
if (!ctx->CompileFlag)
ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
* COMPILE_AND_EXEC modes, need to keep exec primitive uptodate
* otherwise.
*/
- if (ctx->CompileFlag)
+ if (ctx->CompileFlag)
ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
}
static void
_tnl_TexCoord2f( GLfloat s, GLfloat t )
{
- TEXCOORD2F(s,t);
+ TEXCOORD2F(s,t);
}
_tnl_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
{
GET_IMMEDIATE;
- VERTEX3F( IM, x, y, z );
+ VERTEX3F( IM, x, y, z );
}
static void
_tnl_Vertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
/* KW: Because the eval values don't become 'current', fixup will flow
* through these vertices, and then evaluation will write on top
- * of the fixup results.
+ * of the fixup results.
*
- * Note: using Obj to hold eval coord data.
+ * Note: using Obj to hold eval coord data.
*/
#define EVALCOORD1(IM, x) \
{ \
if (count == IMM_MAXDATA-1) \
_tnl_flush_immediate( IM ); \
}
-
+
#define EVALPOINT2(IM, x, y) \
{ \
GLuint count = IM->Count++; \
}
-/* Internal functions. These are safe to use providing either:
- *
+/* Internal functions. These are safe to use providing either:
+ *
* - It is determined that a display list is not being compiled, or
* if so that these commands won't be compiled into the list (see
- * t_eval.c for an example).
+ * t_eval.c for an example).
*
* - _tnl_hard_begin() is used instead of _tnl_[bB]egin, and tested
* for a GL_TRUE return value. See _tnl_Rectf, below.
if (!IM->Material) {
IM->Material = (GLmaterial (*)[2]) MALLOC( sizeof(GLmaterial) *
IMM_SIZE * 2 );
- IM->MaterialMask = (GLuint *) MALLOC( sizeof(GLuint) * IMM_SIZE );
+ IM->MaterialMask = (GLuint *) MALLOC( sizeof(GLuint) * IMM_SIZE );
}
else if (IM->MaterialOrMask & ~bitmask) {
- _mesa_copy_material_pairs( IM->Material[count],
+ _mesa_copy_material_pairs( IM->Material[count],
IM->Material[IM->LastMaterial],
IM->MaterialOrMask & ~bitmask );
}
IM->LastMaterial = count;
IM->MaterialMask[count] = 0;
}
-
+
IM->MaterialOrMask |= bitmask;
IM->MaterialMask[count] |= bitmask;
mat = IM->Material[count];
vfmt->Vertex4f = _tnl_Vertex4f;
vfmt->Vertex4fv = _tnl_Vertex4fv;
- /* Outside begin/end functions (from t_varray.c, t_eval.c, ...):
+ /* Outside begin/end functions (from t_varray.c, t_eval.c, ...):
*/
vfmt->Rectf = _tnl_Rectf;
/* Just use the core function:
*/
- vfmt->CallList = _mesa_CallList;
+ vfmt->CallList = _mesa_CallList;
vfmt->prefer_float_colors = GL_FALSE;
}
-/* $Id: t_imm_api.h,v 1.2 2001/01/08 21:56:00 keithw Exp $ */
+/* $Id: t_imm_api.h,v 1.3 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/* $Id: t_imm_debug.c,v 1.1 2000/12/26 05:09:32 keithw Exp $ */
+/* $Id: t_imm_debug.c,v 1.2 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
#include "t_context.h"
#include "t_imm_debug.h"
-void _tnl_print_vert_flags( const char *name, GLuint flags )
+void _tnl_print_vert_flags( const char *name, GLuint flags )
{
fprintf(stderr,
"%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
);
}
-void _tnl_print_cassette( struct immediate *IM )
+void _tnl_print_cassette( struct immediate *IM )
{
GLuint i;
GLuint *flags = IM->Flag;
GLuint state = IM->BeginState;
GLuint req = ~0;
- fprintf(stderr, "Cassette id %d, %u rows.\n", IM->id,
+ fprintf(stderr, "Cassette id %d, %u rows.\n", IM->id,
IM->Count - IM->CopyStart);
_tnl_print_vert_flags("Contains at least one", orflag);
if (IM->Count != IM->CopyStart)
{
_tnl_print_vert_flags("Contains a full complement of", andflag);
-
+
fprintf(stderr, "Final begin/end state %s/%s, errors %s/%s\n",
(state & VERT_BEGIN_0) ? "in" : "out",
(state & VERT_BEGIN_1) ? "in" : "out",
GLuint j;
for (j = 0 ; j < MAX_TEXTURE_UNITS ; j++) {
if (req & flags[i] & VERT_TEX(j)) {
- fprintf(stderr,
+ fprintf(stderr,
"TC%d %f %f %f %f",
j,
IM->TexCoord[j][i][0], IM->TexCoord[j][i][1],
if (req & flags[i] & VERT_MATERIAL)
fprintf(stderr, " Material ");
-
+
/* The order of these two is not easily knowable, but this is
* the usually correct way to look at them.
fprintf(stderr, " END ");
if (req & flags[i] & VERT_BEGIN)
- fprintf(stderr, " BEGIN(%s) (%s%s%s%s)",
+ fprintf(stderr, " BEGIN(%s) (%s%s%s%s)",
_mesa_prim_name[IM->Primitive[i] & PRIM_MODE_MASK],
(IM->Primitive[i] & PRIM_LAST) ? "LAST," : "",
(IM->Primitive[i] & PRIM_BEGIN) ? "BEGIN," : "",
fprintf(stderr, "\n");
}
}
-
-
-
+/* $Id: t_imm_debug.h,v 1.2 2001/03/12 00:48:43 gareth Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
+ */
#ifndef _T_DEBUG_H
#define _T_DEBUG_H
-/* $Id: t_imm_dlist.c,v 1.10 2001/03/03 20:33:31 brianp Exp $ */
+/* $Id: t_imm_dlist.c,v 1.11 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
- * Keith Whitwell <keithw@valinux.com>
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
*/
/* Insert the active immediate struct onto the display list currently
* being built.
*/
-void
+void
_tnl_compile_cassette( GLcontext *ctx, struct immediate *IM )
{
struct immediate *im = TNL_CURRENT_IM(ctx);
GLuint andflag = ~0;
GLuint i;
GLuint start = IM->FlushElt ? IM->LastPrimitive : IM->CopyStart;
- _tnl_translate_array_elts( ctx, IM, start, IM->Count );
+ _tnl_translate_array_elts( ctx, IM, start, IM->Count );
/* Need to recompute andflag.
*/
IM->PrimitiveLength[IM->LastPrimitive] = IM->Count - IM->LastPrimitive;
ASSERT(IM->Primitive[IM->LastPrimitive] & PRIM_LAST);
-
- node = (TNLvertexcassette *)
- _mesa_alloc_instruction(ctx,
+
+ node = (TNLvertexcassette *)
+ _mesa_alloc_instruction(ctx,
tnl->opcode_vertex_cassette,
sizeof(TNLvertexcassette));
- if (!node)
+ if (!node)
return;
-
+
node->IM = im; im->ref_count++;
node->Start = im->Start;
node->Count = im->Count;
if (ctx->ExecuteFlag) {
execute_compiled_cassette( ctx, (void *)node );
}
-
-
+
+
/* Discard any errors raised in the last cassette.
*/
new_beginstate = node->BeginState & (VERT_BEGIN_0|VERT_BEGIN_1);
if (im->Count > IMM_MAXDATA - 16) {
/* Call it full...
*/
- struct immediate *new_im = _tnl_alloc_immediate(ctx);
+ struct immediate *new_im = _tnl_alloc_immediate(ctx);
if (!new_im) return;
new_im->ref_count++;
im->ref_count--; /* remove CURRENT_IM reference */
*/
_tnl_reset_input( ctx, im->Count+1+IMM_MAX_COPIED_VERTS,
new_beginstate, node->SavedBeginState);
- }
+ }
}
-static void
+static void
execute_compiled_cassette( GLcontext *ctx, void *data )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
if (tnl->pipeline.build_state_changes)
_tnl_validate_pipeline( ctx );
-
+
IM->Start = node->Start;
IM->CopyStart = node->Start;
IM->Count = node->Count;
IM->BeginState = node->BeginState;
- IM->SavedBeginState = node->SavedBeginState;
+ IM->SavedBeginState = node->SavedBeginState;
IM->OrFlag = node->OrFlag;
- IM->TexSize = node->TexSize;
+ IM->TexSize = node->TexSize;
IM->AndFlag = node->AndFlag;
IM->LastData = node->LastData;
IM->LastPrimitive = node->LastPrimitive;
_tnl_fixup_compiled_cassette( ctx, IM );
_tnl_get_exec_copy_verts( ctx, IM );
- _tnl_run_cassette( ctx, IM );
+ _tnl_run_cassette( ctx, IM );
_tnl_restore_compiled_cassette( ctx, IM );
if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1)
}
-static void
+static void
print_compiled_cassette( GLcontext *ctx, void *data )
{
TNLvertexcassette *node = (TNLvertexcassette *)data;
struct immediate *IM = node->IM;
- fprintf(stderr, "TNL-VERTEX-CASSETTE, id %u, rows %u..%u\n",
+ fprintf(stderr, "TNL-VERTEX-CASSETTE, id %u, rows %u..%u\n",
node->IM->id, node->Start, node->Count);
IM->Start = node->Start;
_tnl_EndCallList( GLcontext *ctx )
{
/* May have to copy vertices from a dangling begin/end inside the
- * list to the current immediate.
+ * list to the current immediate.
*/
if (ctx->CallDepth == 0) {
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct immediate *IM = TNL_CURRENT_IM(ctx);
- if (tnl->ExecCopySource != IM)
+ if (tnl->ExecCopySource != IM)
_tnl_copy_immediate_vertices( ctx, IM );
}
}
-void
+void
_tnl_EndList( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
SET_IMMEDIATE( ctx, IM );
IM->ref_count++;
- _tnl_reset_input( ctx, IMM_MAX_COPIED_VERTS, 0, 0 );
+ _tnl_reset_input( ctx, IMM_MAX_COPIED_VERTS, 0, 0 );
- /* outside begin/end, even in COMPILE_AND_EXEC,
- * so no vertices to copy, right?
+ /* outside begin/end, even in COMPILE_AND_EXEC,
+ * so no vertices to copy, right?
*/
ASSERT(TNL_CONTEXT(ctx)->ExecCopyCount == 0);
}
-void
+void
_tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode )
{
struct immediate *IM = TNL_CURRENT_IM(ctx);
}
-void
+void
_tnl_dlist_init( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->opcode_vertex_cassette =
+ tnl->opcode_vertex_cassette =
_mesa_alloc_opcode( ctx,
sizeof(TNLvertexcassette),
execute_compiled_cassette,
destroy_compiled_cassette,
print_compiled_cassette );
}
-
-/* $Id: t_imm_dlist.h,v 1.2 2001/01/08 21:56:00 keithw Exp $ */
+/* $Id: t_imm_dlist.h,v 1.3 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
- * Keith Whitwell <keithw@valinux.com>
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
*/
#ifndef _T_DLIST_H
-/* $Id: t_imm_elt.c,v 1.5 2001/03/08 15:23:47 brianp Exp $ */
+/* $Id: t_imm_elt.c,v 1.6 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
GLuint start,
GLuint n )
{
- _tnl_trans_elt_1f_tab[TYPE_IDX(from->Type)]( to,
+ _tnl_trans_elt_1f_tab[TYPE_IDX(from->Type)]( to,
from->Ptr,
from->StrideB,
flags,
match,
start,
n );
-
+
}
static void _tnl_trans_elt_1ui(GLuint *to,
GLuint start,
GLuint n )
{
- _tnl_trans_elt_1ui_tab[TYPE_IDX(from->Type)]( to,
+ _tnl_trans_elt_1ui_tab[TYPE_IDX(from->Type)]( to,
from->Ptr,
from->StrideB,
flags,
match,
start,
n );
-
+
}
GLuint start,
GLuint n )
{
- _tnl_trans_elt_1ub_tab[TYPE_IDX(from->Type)]( to,
+ _tnl_trans_elt_1ub_tab[TYPE_IDX(from->Type)]( to,
from->Ptr,
from->StrideB,
flags,
match,
start,
n );
-
+
}
GLuint start,
GLuint n )
{
- _tnl_trans_elt_4ub_tab[from->Size][TYPE_IDX(from->Type)]( to,
+ _tnl_trans_elt_4ub_tab[from->Size][TYPE_IDX(from->Type)]( to,
from->Ptr,
from->StrideB,
flags,
match,
start,
n );
-
+
}
static void _tnl_trans_elt_4us(GLushort (*to)[4],
GLuint start,
GLuint n )
{
- _tnl_trans_elt_4us_tab[from->Size][TYPE_IDX(from->Type)]( to,
+ _tnl_trans_elt_4us_tab[from->Size][TYPE_IDX(from->Type)]( to,
from->Ptr,
from->StrideB,
flags,
match,
start,
n );
-
+
}
static void _tnl_trans_elt_4f(GLfloat (*to)[4],
GLuint start,
GLuint n )
{
- _tnl_trans_elt_4f_tab[from->Size][TYPE_IDX(from->Type)]( to,
+ _tnl_trans_elt_4f_tab[from->Size][TYPE_IDX(from->Type)]( to,
from->Ptr,
from->StrideB,
flags,
match,
start,
n );
-
+
}
static void _tnl_trans_elt_4chan(GLchan (*to)[4],
GLuint start,
GLuint n )
{
- _tnl_trans_elt_3f_tab[TYPE_IDX(from->Type)]( to,
+ _tnl_trans_elt_3f_tab[TYPE_IDX(from->Type)]( to,
from->Ptr,
from->StrideB,
flags,
/* Batch function to translate away all the array elements in the
* input buffer prior to transform. Done only the first time a vertex
- * buffer is executed or compiled.
+ * buffer is executed or compiled.
*
- * KW: Have to do this after each glEnd if arrays aren't locked.
+ * KW: Have to do this after each glEnd if arrays aren't locked.
*/
void _tnl_translate_array_elts( GLcontext *ctx, struct immediate *IM,
- GLuint start, GLuint count )
+ GLuint start, GLuint count )
{
GLuint *flags = IM->Flag;
GLuint *elts = IM->Elt;
if (ctx->Array.TexCoord[i].Size == 4)
IM->TexSize |= TEX_SIZE_4(i);
else if (ctx->Array.TexCoord[i].Size == 3)
- IM->TexSize |= TEX_SIZE_3(i);
+ IM->TexSize |= TEX_SIZE_3(i);
}
}
- for (i = start ; i < count ; i++)
+ for (i = start ; i < count ; i++)
if (flags[i] & VERT_ELT) flags[i] |= translate;
IM->CopyOrFlag |= translate;
}
-
-
-/* $Id: t_imm_elt.h,v 1.1 2000/12/26 05:09:32 keithw Exp $ */
+/* $Id: t_imm_elt.h,v 1.2 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
extern void _tnl_imm_elt_init( void );
-extern void _tnl_translate_array_elts( GLcontext *ctx,
+extern void _tnl_translate_array_elts( GLcontext *ctx,
struct immediate *IM,
GLuint start,
GLuint end );
-/* $Id: t_imm_eval.c,v 1.5 2001/02/20 18:28:52 keithw Exp $ */
+/* $Id: t_imm_eval.c,v 1.6 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
if (flags[i] & (VERT_EVAL_C1|VERT_EVAL_P1)) {
GLfloat u = (coord[i][0] - u1) * du;
ASSIGN_4V(to[i], 0,0,0,1);
- _math_horner_bezier_curve(map->Points, to[i], u,
+ _math_horner_bezier_curve(map->Points, to[i], u,
dimension, map->Order);
}
static void eval1_norm( GLvector3f *dest,
GLfloat coord[][4],
- const GLuint *flags,
+ const GLuint *flags,
struct gl_1d_map *map )
{
const GLfloat u1 = map->u1;
static void copy_4f( GLfloat to[][4], GLfloat from[][4], GLuint count )
{
- MEMCPY( to, from, count * sizeof(to[0]));
+ MEMCPY( to, from, count * sizeof(to[0]));
}
static void copy_3f( GLfloat to[][3], GLfloat from[][3], GLuint count )
{
- MEMCPY( to, from, (count) * sizeof(to[0]));
+ MEMCPY( to, from, (count) * sizeof(to[0]));
}
static void copy_4chan( GLchan to[][4], GLchan from[][4], GLuint count )
{
- MEMCPY( to, from, (count) * sizeof(to[0]));
+ MEMCPY( to, from, (count) * sizeof(to[0]));
}
static void copy_1ui( GLuint to[], GLuint from[], GLuint count )
{
- MEMCPY( to, from, (count) * sizeof(to[0]));
+ MEMCPY( to, from, (count) * sizeof(to[0]));
}
eval1 |= VERT_OBJ_23;
if (ctx->Eval.Map2Vertex4) {
- if (ctx->Eval.AutoNormal)
+ if (ctx->Eval.AutoNormal)
eval2 |= VERT_OBJ_234 | VERT_NORM;
else
eval2 |= VERT_OBJ_234;
}
else if (ctx->Eval.Map2Vertex3) {
- if (ctx->Eval.AutoNormal)
+ if (ctx->Eval.AutoNormal)
eval2 |= VERT_OBJ_23 | VERT_NORM;
else
eval2 |= VERT_OBJ_23;
/* This looks a lot like a pipeline stage, but for various reasons is
* better handled outside the pipeline, and considered the final stage
- * of fixing up an immediate struct for execution.
+ * of fixing up an immediate struct for execution.
*
* Really want to cache the results of this function in display lists,
- * at least for EvalMesh commands.
+ * at least for EvalMesh commands.
*/
-void _tnl_eval_vb( GLcontext *ctx,
+void _tnl_eval_vb( GLcontext *ctx,
GLfloat (*coord)[4],
- GLuint orflag,
+ GLuint orflag,
GLuint andflag )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
if (any_eval1 && !ctx->Eval.Map1Vertex4 && !ctx->Eval.Map1Vertex3)
purge_flags = (VERT_EVAL_P1|VERT_EVAL_C1);
- if (any_eval2 && !ctx->Eval.Map2Vertex4 && !ctx->Eval.Map2Vertex3)
+ if (any_eval2 && !ctx->Eval.Map2Vertex4 && !ctx->Eval.Map2Vertex3)
purge_flags |= (VERT_EVAL_P1|VERT_EVAL_C1);
- if (any_eval1)
+ if (any_eval1)
req |= tnl->pipeline.inputs & tnl->eval.EvalMap1Flags;
- if (any_eval2)
+ if (any_eval2)
req |= tnl->pipeline.inputs & tnl->eval.EvalMap2Flags;
-
+
/* Translate points into coords. Use store->Coord to hold the
- * new data.
+ * new data.
*/
if (any_eval1 && (orflag & VERT_EVAL_P1))
{
*/
if (req & VERT_INDEX)
{
- if (!all_eval)
+ if (!all_eval)
copy_1ui( store->Index, tmp->Index.data, count );
tmp->Index.data = store->Index;
tmp->Index.start = store->Index;
- if (ctx->Eval.Map1Index && any_eval1)
+ if (ctx->Eval.Map1Index && any_eval1)
eval1_1ui( &tmp->Index, coord, flags, &ctx->EvalMap.Map1Index );
if (ctx->Eval.Map2Index && any_eval2)
if (req & VERT_TEX(0))
{
- if (!all_eval)
+ if (!all_eval)
copy_4f( store->TexCoord, tmp->TexCoord[0].data, count );
- else
+ else
tmp->TexCoord[0].size = 0;
-
+
tmp->TexCoord[0].data = store->TexCoord;
tmp->TexCoord[0].start = (GLfloat *)store->TexCoord;
else if (ctx->Eval.Map1TextureCoord2) {
eval1_4f( &tmp->TexCoord[0], coord, flags, 2,
&ctx->EvalMap.Map1Texture2 );
- }
+ }
else if (ctx->Eval.Map1TextureCoord1) {
eval1_4f( &tmp->TexCoord[0], coord, flags, 1,
&ctx->EvalMap.Map1Texture1 );
&ctx->EvalMap.Map2Texture4 );
}
else if (ctx->Eval.Map2TextureCoord3) {
- eval2_4f( &tmp->TexCoord[0], coord, flags, 3,
+ eval2_4f( &tmp->TexCoord[0], coord, flags, 3,
&ctx->EvalMap.Map2Texture3 );
}
else if (ctx->Eval.Map2TextureCoord2) {
if (any_eval1) {
if (ctx->Eval.Map1Vertex4) {
- eval1_4f( &tmp->Obj, coord, flags, 4,
+ eval1_4f( &tmp->Obj, coord, flags, 4,
&ctx->EvalMap.Map1Vertex4 );
}
else if (ctx->Eval.Map1Vertex3) {
if (any_eval2) {
if (ctx->Eval.Map2Vertex4)
{
- if (ctx->Eval.AutoNormal && (req & VERT_NORM))
- eval2_obj_norm( &tmp->Obj, &tmp->Normal, coord, flags, 4,
+ if (ctx->Eval.AutoNormal && (req & VERT_NORM))
+ eval2_obj_norm( &tmp->Obj, &tmp->Normal, coord, flags, 4,
&ctx->EvalMap.Map2Vertex4 );
else
- eval2_4f( &tmp->Obj, coord, flags, 4,
+ eval2_4f( &tmp->Obj, coord, flags, 4,
&ctx->EvalMap.Map2Vertex4 );
}
else if (ctx->Eval.Map2Vertex3)
{
- if (ctx->Eval.AutoNormal && (req & VERT_NORM))
+ if (ctx->Eval.AutoNormal && (req & VERT_NORM))
eval2_obj_norm( &tmp->Obj, &tmp->Normal, coord, flags, 3,
&ctx->EvalMap.Map2Vertex3 );
else
GLuint i;
copy_1ui( store->Flag, flags, count );
tnl->vb.Flag = store->Flag;
-
+
/* This is overkill, but correct as fixup will have copied the
* values to all vertices in the VB - we may be falsely stating
* that some repeated values are new, but doing so is fairly
store->Flag[i] |= req;
}
}
-
-
-
-
-
-
-
-/* $Id: t_imm_eval.h,v 1.1 2000/12/26 05:09:32 keithw Exp $ */
+/* $Id: t_imm_eval.h,v 1.2 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-/* $Id: t_imm_exec.c,v 1.15 2001/03/08 15:23:47 brianp Exp $ */
+/* $Id: t_imm_exec.c,v 1.16 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keithw@valinux.com>
*/
/* Called to initialize new buffers, and to recycle old ones.
*/
-void _tnl_reset_input( GLcontext *ctx,
+void _tnl_reset_input( GLcontext *ctx,
GLuint start,
- GLuint beginstate,
+ GLuint beginstate,
GLuint savedbeginstate )
{
struct immediate *IM = TNL_CURRENT_IM(ctx);
IM->CopyStart = IM->Start = IM->Count = start;
IM->Primitive[IM->Start] = (ctx->Driver.CurrentExecPrimitive | PRIM_LAST);
IM->LastPrimitive = IM->Start;
- IM->BeginState = beginstate;
+ IM->BeginState = beginstate;
IM->SavedBeginState = savedbeginstate;
IM->TexSize = 0;
IM->LastMaterial = 0;
if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
_tnl_print_vert_flags("copy to current", flag);
- if (flag & VERT_NORM)
- COPY_3FV( ctx->Current.Normal, IM->Normal[count]);
-
+ if (flag & VERT_NORM)
+ COPY_3FV( ctx->Current.Normal, IM->Normal[count]);
+
if (flag & VERT_INDEX)
ctx->Current.Index = IM->Index[count];
}
if (flag & VERT_MATERIAL) {
- _mesa_update_material( ctx,
- IM->Material[IM->LastMaterial],
+ _mesa_update_material( ctx,
+ IM->Material[IM->LastMaterial],
IM->MaterialOrMask );
-
+
_mesa_validate_all_lighting_tables( ctx );
}
}
* calls like 'glNormal', 'glMaterial' that occur after the final
* glVertex, glEval, etc. Additionally, a buffer can consist of
* eg. a single glMaterial call, in which case IM->Start ==
- * IM->Count, but the buffer is definitely not empty.
+ * IM->Count, but the buffer is definitely not empty.
*/
if (IM->Flag[i] & VERT_DATA) {
IM->LastData++;
/* Note: The 'start' member of the GLvector structs is now redundant
* because we always re-transform copied vertices, and the vectors
* below are set up so that the first copied vertex (if any) appears
- * at position zero.
+ * at position zero.
*/
static void _tnl_vb_bind_immediate( GLcontext *ctx, struct immediate *IM )
{
GLuint inputs = tnl->pipeline.inputs; /* for copy-to-current */
GLuint start = IM->CopyStart;
GLuint count = IM->Count - start;
-
+
/* TODO: optimize the case where nothing has changed. (Just bind
* tmp to vb).
*/
tmp->Obj.data = IM->Obj + start;
tmp->Obj.start = (GLfloat *)(IM->Obj + start);
tmp->Obj.count = count;
- VB->ObjPtr = &tmp->Obj;
- if ((IM->CopyOrFlag & VERT_OBJ_234) == VERT_OBJ_234)
+ VB->ObjPtr = &tmp->Obj;
+ if ((IM->CopyOrFlag & VERT_OBJ_234) == VERT_OBJ_234)
tmp->Obj.size = 4;
- else if ((IM->CopyOrFlag & VERT_OBJ_234) == VERT_OBJ_23)
+ else if ((IM->CopyOrFlag & VERT_OBJ_234) == VERT_OBJ_23)
tmp->Obj.size = 3;
else
tmp->Obj.size = 2;
tmp->TexCoord[i].size = 2;
if (IM->TexSize & TEX_SIZE_3(i)) {
tmp->TexCoord[i].size = 3;
- if (IM->TexSize & TEX_SIZE_4(i))
+ if (IM->TexSize & TEX_SIZE_4(i))
tmp->TexCoord[i].size = 4;
}
VB->TexCoordPtr[i] = &tmp->TexCoord[i];
if ((inputs & VERT_MATERIAL) && IM->Material) {
VB->MaterialMask = IM->MaterialMask + start;
VB->Material = IM->Material + start;
- }
+ }
}
_tnl_vb_bind_immediate( ctx, IM );
- if (IM->CopyOrFlag & VERT_EVAL_ANY)
- _tnl_eval_vb( ctx,
- IM->Obj + IM->CopyStart,
- IM->CopyOrFlag,
+ if (IM->CopyOrFlag & VERT_EVAL_ANY)
+ _tnl_eval_vb( ctx,
+ IM->Obj + IM->CopyStart,
+ IM->CopyOrFlag,
IM->CopyAndFlag );
-
+
/* Invalidate all stored data before and after run:
*/
tnl->pipeline.run_input_changes |= tnl->pipeline.inputs;
- _tnl_run_pipeline( ctx );
+ _tnl_run_pipeline( ctx );
tnl->pipeline.run_input_changes |= tnl->pipeline.inputs;
- _tnl_copy_to_current( ctx, IM, IM->OrFlag );
+ _tnl_copy_to_current( ctx, IM, IM->OrFlag );
}
/* Called for pure, locked VERT_ELT cassettes instead of
- * _tnl_run_cassette.
+ * _tnl_run_cassette.
*/
static void exec_elt_cassette( GLcontext *ctx, struct immediate *IM )
{
* TODO: delay this until FlushVertices
*/
if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1) {
- _tnl_translate_array_elts( ctx, IM, IM->LastData, IM->LastData );
+ _tnl_translate_array_elts( ctx, IM, IM->LastData, IM->LastData );
_tnl_copy_to_current( ctx, IM, ctx->Array._Enabled );
}
}
-/* Called for regular vertex cassettes.
+/* Called for regular vertex cassettes.
*/
static void exec_vert_cassette( GLcontext *ctx, struct immediate *IM )
{
GLuint andflag = ~0;
GLuint i;
GLuint start = IM->FlushElt ? IM->LastPrimitive : IM->CopyStart;
- _tnl_translate_array_elts( ctx, IM, start, IM->Count );
+ _tnl_translate_array_elts( ctx, IM, start, IM->Count );
/* Need to recompute andflag.
*/
_tnl_fixup_input( ctx, IM );
/* _tnl_print_cassette( IM ); */
- _tnl_run_cassette( ctx, IM );
+ _tnl_run_cassette( ctx, IM );
}
_tnl_validate_pipeline( ctx );
_tnl_get_exec_copy_verts( ctx, IM );
-
+
if (IM->CopyStart == IM->Count) {
- if (IM->OrFlag & VERT_ELT)
- _tnl_translate_array_elts( ctx, IM, IM->CopyStart, IM->CopyStart );
+ if (IM->OrFlag & VERT_ELT)
+ _tnl_translate_array_elts( ctx, IM, IM->CopyStart, IM->CopyStart );
_tnl_copy_to_current( ctx, IM, IM->OrFlag );
}
- else if ((IM->OrFlag & VERT_DATA) == VERT_ELT &&
+ else if ((IM->OrFlag & VERT_DATA) == VERT_ELT &&
ctx->Array.LockCount &&
ctx->Array.Vertex.Enabled) {
exec_elt_cassette( ctx, IM );
exec_vert_cassette( ctx, IM );
}
- _tnl_reset_input( ctx,
+ _tnl_reset_input( ctx,
IMM_MAX_COPIED_VERTS,
- IM->BeginState & (VERT_BEGIN_0|VERT_BEGIN_1),
- IM->SavedBeginState );
+ IM->BeginState & (VERT_BEGIN_0|VERT_BEGIN_1),
+ IM->SavedBeginState );
/* Copy vertices and primitive information to immediate before it
- * can be overwritten.
+ * can be overwritten.
*/
_tnl_copy_immediate_vertices( ctx, IM );
_mesa_vector1ui_init( &tmp->Index, 0, 0 );
_mesa_vector1ub_init( &tmp->EdgeFlag, 0, 0 );
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
_mesa_vector4f_init( &tmp->TexCoord[i], 0, 0);
/* Install the first immediate. Intially outside begin/end.
void _tnl_imm_destroy( GLcontext *ctx )
{
- if (TNL_CURRENT_IM(ctx))
+ if (TNL_CURRENT_IM(ctx))
_tnl_free_immediate( TNL_CURRENT_IM(ctx) );
}
-/* $Id: t_imm_exec.h,v 1.3 2001/02/15 01:33:52 keithw Exp $ */
+/* $Id: t_imm_exec.h,v 1.4 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
extern void _tnl_imm_destroy( GLcontext *ctx );
-extern void _tnl_reset_input( GLcontext *ctx,
+extern void _tnl_reset_input( GLcontext *ctx,
GLuint start,
- GLuint beginstate,
+ GLuint beginstate,
GLuint savedbeginstate );
extern void _tnl_compute_orflag( struct immediate *IM );
-/* $Id: t_imm_fixup.c,v 1.8 2001/03/03 20:33:31 brianp Exp $ */
+/* $Id: t_imm_fixup.c,v 1.9 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
/*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keithw@valinux.com>
*/
fixup = ~andflag & VERT_FIXUP;
- if (!ctx->CompileFlag)
+ if (!ctx->CompileFlag)
fixup &= tnl->pipeline.inputs;
if (!ctx->ExecuteFlag)
if (fixup) {
GLuint copy = fixup & ~IM->Flag[start];
-
+
/* Equivalent to a lazy copy-from-current when setting up the
* immediate.
*/
if (copy & VERT_INDEX)
IM->Index[start] = ctx->Current.Index;
-
+
if (copy & VERT_EDGE)
IM->EdgeFlag[start] = ctx->Current.EdgeFlag;
GLuint i;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
if (fixup & VERT_TEX(i)) {
- if (orflag & VERT_TEX(i))
+ if (orflag & VERT_TEX(i))
fixup_4f( IM->TexCoord[i], IM->Flag, start, VERT_TEX(i) );
else
fixup_first_4f( IM->TexCoord[i], IM->Flag, VERT_END_VB, start,
IMM_SIZE * 2 );
next->MaterialMask = (GLuint *) MALLOC( sizeof(GLuint) * IMM_SIZE );
}
-
+
next->MaterialMask[dst] = prev->MaterialMask[src];
MEMCPY(next->Material[dst], prev->Material[src], 2*sizeof(GLmaterial));
}
* primitives.
*
* Have to be careful with the transitions between display list
- * replay, compile and normal execute modes.
+ * replay, compile and normal execute modes.
*/
static void copy_vertices( GLcontext *ctx,
struct immediate *next,
GLuint offset = IMM_MAX_COPIED_VERTS - count;
GLuint i;
- next->CopyStart = next->Start - count;
+ next->CopyStart = next->Start - count;
/* Copy the vertices
*/
GLuint dst = next->CopyStart+i;
COPY_4FV( next->Obj[dst], prev->Obj[src] );
- COPY_3FV( next->Normal[dst], prev->Normal[src] );
+ COPY_3FV( next->Normal[dst], prev->Normal[src] );
COPY_CHAN4( next->Color[dst], prev->Color[src] );
if (prev->OrFlag & VERT_TEX_ANY) {
next->CopyOrFlag |= prev->Flag[src]; /* redundant for current_im */
next->CopyAndFlag &= prev->Flag[src]; /* redundant for current_im */
}
-
+
ASSERT(prev == tnl->ExecCopySource);
if (--tnl->ExecCopySource->ref_count == 0)
_tnl_free_immediate( tnl->ExecCopySource );
-
+
next->ref_count++;
tnl->ExecCopySource = next;
/* Need to push this in now as it won't be computed anywhere else/
*/
IM->TexSize = tnl->ExecCopyTexSize;
-
+
/* A wrapped primitive. We may be copying into a revived
* display list immediate, or onto the front of a new execute-mode
* immediate.
*/
- copy_vertices( ctx, IM,
- tnl->ExecCopySource,
+ copy_vertices( ctx, IM,
+ tnl->ExecCopySource,
tnl->ExecCopyCount,
tnl->ExecCopyElts );
-
+
if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1) {
/* Immediates are built by default to be correct in this state,
* and copying to the first slots of an immediate doesn't remove
ASSERT(IM->CopyStart == IM->Start);
}
- /* Copy the primitive information:
+ /* Copy the primitive information:
*/
IM->Primitive[IM->CopyStart] = (ctx->Driver.CurrentExecPrimitive | PRIM_LAST);
IM->LastPrimitive = IM->CopyStart;
if (tnl->ExecParity)
IM->Primitive[IM->CopyStart] |= PRIM_PARITY;
}
-
+
/* Revive a compiled immediate struct - propogate new 'Current'
* values. Often this is redundant because the current values were
IM->CopyAndFlag = IM->AndFlag; /* redundant for current_im */
IM->CopyTexSize = IM->TexSize | tnl->ExecCopyTexSize;
- copy_vertices( ctx, IM,
- tnl->ExecCopySource,
+ copy_vertices( ctx, IM,
+ tnl->ExecCopySource,
tnl->ExecCopyCount,
tnl->ExecCopyElts );
/* Can potentially overwrite primitive details - need to save the
- * first slot:
+ * first slot:
*/
tnl->DlistPrimitive = IM->Primitive[IM->Start];
tnl->DlistPrimitiveLength = IM->PrimitiveLength[IM->Start];
if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1) {
GLuint i;
- if (IM->BeginState & VERT_ERROR_1)
+ if (IM->BeginState & VERT_ERROR_1)
_mesa_error( ctx, GL_INVALID_OPERATION, "glBegin/glEnd");
for (i = IM->Start ; i <= IM->Count ; i += IM->PrimitiveLength[i])
- if (IM->Flag[i] & (VERT_BEGIN|VERT_END_VB))
+ if (IM->Flag[i] & (VERT_BEGIN|VERT_END_VB))
break;
/* Would like to just ignore vertices upto this point. Can't
- * set copystart because it might skip materials?
+ * set copystart because it might skip materials?
*/
ASSERT(IM->Start == IM->CopyStart);
if (i > IM->CopyStart) {
} else {
GLuint i;
- if (IM->BeginState & VERT_ERROR_0)
+ if (IM->BeginState & VERT_ERROR_0)
_mesa_error( ctx, GL_INVALID_OPERATION, "glBegin/glEnd");
-
+
if (IM->CopyStart == IM->Start &&
IM->Flag[IM->Start] & (VERT_END|VERT_END_VB))
{
}
- else
+ else
{
IM->Primitive[IM->CopyStart] = ctx->Driver.CurrentExecPrimitive;
- if (tnl->ExecParity)
- IM->Primitive[IM->CopyStart] |= PRIM_PARITY;
-
-
+ if (tnl->ExecParity)
+ IM->Primitive[IM->CopyStart] |= PRIM_PARITY;
+
+
for (i = IM->Start ; i <= IM->Count ; i += IM->PrimitiveLength[i])
if (IM->Flag[i] & (VERT_END|VERT_END_VB)) {
IM->PrimitiveLength[IM->CopyStart] = i - IM->CopyStart;
if (IM->Flag[i] & VERT_END_VB) {
- IM->Primitive[IM->CopyStart] |= PRIM_LAST;
+ IM->Primitive[IM->CopyStart] |= PRIM_LAST;
IM->LastPrimitive = IM->CopyStart;
}
if (IM->Flag[i] & VERT_END) {
if (IM->Primitive[IM->LastPrimitive] & PRIM_END)
ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1;
else
- ctx->Driver.CurrentExecPrimitive =
+ ctx->Driver.CurrentExecPrimitive =
IM->Primitive[IM->LastPrimitive] & PRIM_MODE_MASK;
}
}
-
-
+
+
static void copy_none( TNLcontext *tnl, GLuint start, GLuint count, GLuint ovf)
{
-/* Figure out what vertices need to be copied next time.
+/* Figure out what vertices need to be copied next time.
*/
void
_tnl_get_exec_copy_verts( GLcontext *ctx, struct immediate *IM )
GLuint pincr = increment[prim];
GLuint pintro = intro[prim];
GLuint ovf = 0;
-
+
if (tnl->ExecCopySource != IM) {
if (--tnl->ExecCopySource->ref_count == 0)
if (pincr != 1 && (IM->Count - last - pintro))
ovf = (IM->Count - last - pintro) % pincr;
-
+
if (last < IM->Count)
copy_tab[prim]( tnl, last, IM->Count, ovf );
}
* etc.
*
* Generate the index list that will be used to render this immediate
- * struct.
+ * struct.
*
* Finally, generate a new primitives list for rendering the indices.
*/
GLuint good_index = (VERT_EVAL_ANY & ~purge)|VERT_OBJ;
GLuint prim_length = 0, lastprim = 0, nextprim = 0;
- if (fixup & VERT_TEX0)
+ if (fixup & VERT_TEX0)
fixup_4f( store->TexCoord, flags, 0, VERT_TEX0|fixup_fence );
- if (fixup & VERT_INDEX)
+ if (fixup & VERT_INDEX)
fixup_1ui( store->Index, flags, 0, VERT_INDEX|fixup_fence );
- if (fixup & VERT_RGBA)
+ if (fixup & VERT_RGBA)
fixup_4chan( store->Color, flags, 0, VERT_RGBA|fixup_fence );
- if (fixup & VERT_NORM)
+ if (fixup & VERT_NORM)
fixup_3f( store->Normal, flags, 0, VERT_NORM|fixup_fence );
for (i = 0, j = 0 ; i < tnl->vb.Count ; i++) {
lastprimlen = VB->PrimitiveLength[i];
}
}
-
+
VB->Elts = store->Elts;
/* What about copying??? No immediate exists with the right
-/* $Id: t_imm_fixup.h,v 1.1 2000/12/26 05:09:33 keithw Exp $ */
+/* $Id: t_imm_fixup.h,v 1.2 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
extern void _tnl_fixup_input( GLcontext *ctx, struct immediate *IM );
-extern void _tnl_fixup_compiled_cassette( GLcontext *ctx,
+extern void _tnl_fixup_compiled_cassette( GLcontext *ctx,
struct immediate *IM );
-extern void _tnl_restore_compiled_cassette( GLcontext *ctx,
+extern void _tnl_restore_compiled_cassette( GLcontext *ctx,
struct immediate *IM );
-/* $Id: t_pipeline.c,v 1.13 2001/02/16 00:35:35 keithw Exp $ */
+/* $Id: t_pipeline.c,v 1.14 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
- * Keith Whitwell <keithw@valinux.com>
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
*/
#include "glheader.h"
#include "t_pipeline.h"
-void _tnl_install_pipeline( GLcontext *ctx,
+void _tnl_install_pipeline( GLcontext *ctx,
const struct gl_pipeline_stage **stages )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint i;
- for (i = 0 ; i < tnl->pipeline.nr_stages ; i++)
+ for (i = 0 ; i < tnl->pipeline.nr_stages ; i++)
tnl->pipeline.stages[i].destroy( &tnl->pipeline.stages[i] );
tnl->pipeline.nr_stages = 0;
for (i = pipe->nr_stages+1 ; --i ; s++) {
s->changed_inputs |= s->inputs & changed_inputs;
-
- if (s->check_state & newstate) {
+
+ if (s->check_state & newstate) {
if (s->active) {
GLuint old_outputs = s->outputs;
s->check(ctx, s);
if (!s->active)
changed_inputs |= old_outputs;
}
- else
+ else
s->check(ctx, s);
}
if (s->active) {
pipe->inputs |= s->inputs & ~generated;
generated |= s->outputs;
- }
+ }
}
}
ctx->Driver.PipelineStart( ctx );
/* If something changes in the pipeline, tag all subsequent stages
- * using this value for recalculation.
+ * using this value for recalculation.
*
* Even inactive stages have their state and inputs examined to try
- * to keep cached data alive over state-changes.
+ * to keep cached data alive over state-changes.
*/
for (i = pipe->nr_stages+1 ; --i ; s++) {
s->changed_inputs |= s->inputs & changed_inputs;
if (s->active) {
if (running) {
- if (s->changed_inputs)
+ if (s->changed_inputs)
changed_inputs |= s->outputs;
/* fprintf(stderr, "run %s\n", s->name); */
* simple hardware rasterizers. For customization, I don't recommend
* tampering with the internals of these stages in the way that
* drivers did in Mesa 3.4. These stages are basically black boxes,
- * and should be left intact.
+ * and should be left intact.
*
- * To customize the pipeline, consider:
+ * To customize the pipeline, consider:
*
* - removing redundant stages (making sure that the software rasterizer
* can cope with this on fallback paths). An example is fog
* pipeline by returning GL_FALSE from run(), or do nothing).
*
* Some work can be done to lift some of the restrictions in the final
- * case, if it becomes necessary to do so.
+ * case, if it becomes necessary to do so.
*/
const struct gl_pipeline_stage *_tnl_default_pipeline[] = {
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_point_attenuation_stage,
+ &_tnl_vertex_transform_stage,
+ &_tnl_normal_transform_stage,
+ &_tnl_lighting_stage,
+ &_tnl_fog_coordinate_stage,
+ &_tnl_texgen_stage,
+ &_tnl_texture_transform_stage,
+ &_tnl_point_attenuation_stage,
&_tnl_render_stage,
0
};
-
-/* $Id: t_pipeline.h,v 1.6 2001/02/16 00:35:35 keithw Exp $ */
+/* $Id: t_pipeline.h,v 1.7 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- *
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
extern void _tnl_destroy_pipeline( GLcontext *ctx );
-extern void _tnl_install_pipeline( GLcontext *ctx,
+extern void _tnl_install_pipeline( GLcontext *ctx,
const struct gl_pipeline_stage **stages );
/* These are implemented in the t_vb_*.c files:
*/
-extern const struct gl_pipeline_stage _tnl_vertex_transform_stage;
-extern const struct gl_pipeline_stage _tnl_normal_transform_stage;
-extern const struct gl_pipeline_stage _tnl_lighting_stage;
-extern const struct gl_pipeline_stage _tnl_fog_coordinate_stage;
-extern const struct gl_pipeline_stage _tnl_texgen_stage;
-extern const struct gl_pipeline_stage _tnl_texture_transform_stage;
-extern const struct gl_pipeline_stage _tnl_point_attenuation_stage;
+extern const struct gl_pipeline_stage _tnl_vertex_transform_stage;
+extern const struct gl_pipeline_stage _tnl_normal_transform_stage;
+extern const struct gl_pipeline_stage _tnl_lighting_stage;
+extern const struct gl_pipeline_stage _tnl_fog_coordinate_stage;
+extern const struct gl_pipeline_stage _tnl_texgen_stage;
+extern const struct gl_pipeline_stage _tnl_texture_transform_stage;
+extern const struct gl_pipeline_stage _tnl_point_attenuation_stage;
extern const struct gl_pipeline_stage _tnl_render_stage;
/* Shorthand to plug in the default pipeline:
-/* $Id: t_vb_cliptmp.h,v 1.8 2001/01/29 20:47:39 keithw Exp $ */
+/* $Id: t_vb_cliptmp.h,v 1.9 2001/03/12 00:48:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
/* Clip a triangle against the viewport and user clip planes.
*/
-static __inline void TAG(clip_tri)( GLcontext *ctx,
+static __inline void TAG(clip_tri)( GLcontext *ctx,
GLuint v0, GLuint v1, GLuint v2,
GLubyte mask )
{
/* Clip a quad against the viewport and user clip planes.
*/
-static __inline void TAG(clip_quad)( GLcontext *ctx,
+static __inline void TAG(clip_quad)( GLcontext *ctx,
GLuint v0, GLuint v1, GLuint v2, GLuint v3,
GLubyte mask )
{
-/* $Id: t_vb_fog.c,v 1.7 2001/03/07 05:06:13 brianp Exp $ */
+/* $Id: t_vb_fog.c,v 1.8 2001/03/12 00:48:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
}
-static void make_win_fog_coords( GLcontext *ctx, GLvector1f *out,
+static void make_win_fog_coords( GLcontext *ctx, GLvector1f *out,
const GLvector1f *in )
{
GLfloat end = ctx->Fog.End;
GLfloat *v = in->start;
GLuint stride = in->stride;
GLuint n = in->count;
- GLfloat *data = out->data;
+ GLfloat *data = out->data;
GLfloat d;
GLuint i;
break;
case GL_EXP:
d = ctx->Fog.Density;
- for ( i = 0 ; i < n ; i++, STRIDE_F(v,stride))
+ for ( i = 0 ; i < n ; i++, STRIDE_F(v,stride))
NEG_EXP( data[i], d*ABSF(*v) );
break;
case GL_EXP2:
}
-static GLboolean run_fog_stage( GLcontext *ctx,
+static GLboolean run_fog_stage( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (!ctx->_NeedEyeCoords) {
GLfloat *m = ctx->ModelView.m;
GLfloat plane[4];
-
+
/* Use this to store calculated eye z values:
*/
input = &store->fogcoord;
/* Called the first time stage->run() is invoked.
*/
-static GLboolean alloc_fog_data( GLcontext *ctx,
+static GLboolean alloc_fog_data( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
}
-const struct gl_pipeline_stage _tnl_fog_coordinate_stage =
-{
+const struct gl_pipeline_stage _tnl_fog_coordinate_stage =
+{
"build fog coordinates",
_NEW_FOG,
- _NEW_FOG,
+ _NEW_FOG,
0, 0, VERT_FOG_COORD, /* active, inputs, outputs */
0, 0, /* changed_inputs, private_data */
free_fog_data, /* dtr */
-/* $Id: t_vb_light.c,v 1.11 2001/03/07 05:06:13 brianp Exp $ */
+/* $Id: t_vb_light.c,v 1.12 2001/03/12 00:48:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
_mesa_vector4f_clean_elem(input, VB->Count, 2);
}
}
-
+
if (VB->Flag)
ind = LIGHT_FLAGS;
- else
+ else
ind = 0;
/* The individual tabs know about replaying side-effects vs. full
/* Called in place of do_lighting when the light table may have changed.
*/
-static GLboolean run_validate_lighting( GLcontext *ctx,
+static GLboolean run_validate_lighting( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
GLuint ind = 0;
- light_func *tab;
-
+ light_func *tab;
+
if (ctx->Visual.rgbMode) {
if (ctx->Light._NeedVertices) {
if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
tab = _tnl_light_spec_tab;
else
- tab = _tnl_light_tab;
- }
+ tab = _tnl_light_tab;
+ }
else {
if (ctx->Light.EnabledList.next == ctx->Light.EnabledList.prev)
tab = _tnl_light_fast_single_tab;
if (ctx->Light.ColorMaterialEnabled)
ind |= LIGHT_COLORMATERIAL;
-
+
if (ctx->Light.Model.TwoSide)
ind |= LIGHT_TWOSIDE;
/* Called the first time stage->run is called. In effect, don't
* allocate data until the first time the stage is run.
*/
-static GLboolean run_init_lighting( GLcontext *ctx,
+static GLboolean run_init_lighting( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
if (stage->privatePtr)
stage->run = run_validate_lighting;
stage->inputs = VERT_NORM|VERT_MATERIAL;
- if (ctx->Light._NeedVertices)
+ if (ctx->Light._NeedVertices)
stage->inputs |= VERT_EYE; /* effectively, even when lighting in obj */
- if (ctx->Light.ColorMaterialEnabled)
+ if (ctx->Light.ColorMaterialEnabled)
stage->inputs |= VERT_RGBA;
stage->outputs = VERT_RGBA;
struct light_stage_data *store = LIGHT_STAGE_DATA(stage);
if (store) {
- _mesa_vector4chan_free( &store->LitColor[0] );
- _mesa_vector4chan_free( &store->LitColor[1] );
- _mesa_vector4chan_free( &store->LitSecondary[0] );
- _mesa_vector4chan_free( &store->LitSecondary[1] );
- _mesa_vector1ui_free( &store->LitIndex[0] );
- _mesa_vector1ui_free( &store->LitIndex[1] );
+ _mesa_vector4chan_free( &store->LitColor[0] );
+ _mesa_vector4chan_free( &store->LitColor[1] );
+ _mesa_vector4chan_free( &store->LitSecondary[0] );
+ _mesa_vector4chan_free( &store->LitSecondary[1] );
+ _mesa_vector1ui_free( &store->LitIndex[0] );
+ _mesa_vector1ui_free( &store->LitIndex[1] );
FREE( store );
stage->privatePtr = 0;
}
}
-const struct gl_pipeline_stage _tnl_lighting_stage =
-{
+const struct gl_pipeline_stage _tnl_lighting_stage =
+{
"lighting",
_NEW_LIGHT, /* recheck */
_NEW_LIGHT|_NEW_MODELVIEW, /* recalc -- modelview dependency
check_lighting, /* check */
run_init_lighting /* run -- initially set to ctr */
};
-
-/* $Id: t_vb_lighttmp.h,v 1.9 2001/03/03 20:33:31 brianp Exp $ */
+/* $Id: t_vb_lighttmp.h,v 1.10 2001/03/12 00:48:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# define VSTRIDE vstride
# define NSTRIDE nstride
# define CHECK_MATERIAL(x) 0 /* no materials on array paths */
-# define CHECK_END_VB(XX) (XX >= nr)
+# define CHECK_END_VB(XX) (XX >= nr)
# if (IDX & LIGHT_COLORMATERIAL)
# define CMSTRIDE STRIDE_4CHAN(CMcolor, CMstride)
# define CHECK_COLOR_MATERIAL(x) (x < nr) /* always have colormaterial */
-static void TAG(light_rgba_spec)( GLcontext *ctx,
+static void TAG(light_rgba_spec)( GLcontext *ctx,
struct vertex_buffer *VB,
struct gl_pipeline_stage *stage,
GLvector4f *input )
GLuint vstride = input->stride;
const GLfloat *vertex = (GLfloat *)input->data;
- GLuint nstride = VB->NormalPtr->stride;
+ GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLchan (*CMcolor)[4];
GLuint *new_material_mask = VB->MaterialMask;
(void) flags;
- (void) nstride;
+ (void) nstride;
(void) vstride;
/* fprintf(stderr, "%s\n", __FUNCTION__ ); */
if (stage->changed_inputs == 0)
return;
- for ( j=0 ;
- j<nr ;
- j++,STRIDE_F(vertex,VSTRIDE),STRIDE_F(normal,NSTRIDE),CMSTRIDE)
+ for ( j=0 ;
+ j<nr ;
+ j++,STRIDE_F(vertex,VSTRIDE),STRIDE_F(normal,NSTRIDE),CMSTRIDE)
{
GLfloat sum[2][3], spec[2][3];
struct gl_light *light;
-
- if ( CHECK_COLOR_MATERIAL(j) )
+
+ if ( CHECK_COLOR_MATERIAL(j) )
_mesa_update_color_material( ctx, CMcolor[j] );
if ( CHECK_MATERIAL(j) )
COPY_3V(sum[1], base[1]);
ZERO_3V(spec[1]);
}
-
+
/* Add contribution from each enabled light source */
foreach (light, &ctx->Light.EnabledList) {
GLfloat n_dot_h;
GLfloat correction;
- GLint side;
+ GLint side;
GLfloat contrib[3];
GLfloat attenuation;
GLfloat VP[3]; /* unit vector from vertex to light */
GLfloat invd = 1.0F / d;
SELF_SCALE_SCALAR_3V(VP, invd);
}
-
- attenuation = 1.0F / (light->ConstantAttenuation + d *
- (light->LinearAttenuation + d *
+
+ attenuation = 1.0F / (light->ConstantAttenuation + d *
+ (light->LinearAttenuation + d *
light->QuadraticAttenuation));
/* spotlight attenuation */
if (light->_Flags & LIGHT_SPOT) {
GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection);
-
+
if (PV_dot_dir<light->_CosCutoff) {
continue; /* this light makes no contribution */
}
}
- if (attenuation < 1e-3)
+ if (attenuation < 1e-3)
continue; /* this light makes no contribution */
/* Compute dot product or normal and vector from V to light pos */
else {
if (IDX & LIGHT_TWOSIDE) {
ACC_SCALE_SCALAR_3V( sum[1], attenuation, light->_MatAmbient[1]);
- }
+ }
side = 0;
correction = 1;
- }
+ }
/* diffuse term */
COPY_3V(contrib, light->_MatAmbient[side]);
else {
h = light->_h_inf_norm;
}
-
+
n_dot_h = correction * DOT3(normal, h);
if (n_dot_h > 0.0F) {
UNCLAMPED_FLOAT_TO_RGB_CHAN( Fcolor[j], sum[0] );
UNCLAMPED_FLOAT_TO_RGB_CHAN( Fspec[j], spec[0] );
Fcolor[j][3] = sumA[0];
-
+
if (IDX & LIGHT_TWOSIDE) {
UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
UNCLAMPED_FLOAT_TO_RGB_CHAN( Bspec[j], spec[1] );
Bcolor[j][3] = sumA[1];
}
- }
+ }
}
-static void TAG(light_rgba)( GLcontext *ctx,
+static void TAG(light_rgba)( GLcontext *ctx,
struct vertex_buffer *VB,
struct gl_pipeline_stage *stage,
GLvector4f *input )
GLuint vstride = input->stride;
const GLfloat *vertex = (GLfloat *) input->data;
- GLuint nstride = VB->NormalPtr->stride;
+ GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLchan (*CMcolor)[4];
/* fprintf(stderr, "%s\n", __FUNCTION__ ); */
(void) flags;
- (void) nstride;
+ (void) nstride;
(void) vstride;
if (IDX & LIGHT_COLORMATERIAL) {
if (stage->changed_inputs == 0)
return;
- for ( j=0 ;
- j<nr ;
- j++,STRIDE_F(vertex,VSTRIDE), STRIDE_F(normal,NSTRIDE),CMSTRIDE)
+ for ( j=0 ;
+ j<nr ;
+ j++,STRIDE_F(vertex,VSTRIDE), STRIDE_F(normal,NSTRIDE),CMSTRIDE)
{
GLfloat sum[2][3];
struct gl_light *light;
- if ( CHECK_COLOR_MATERIAL(j) )
+ if ( CHECK_COLOR_MATERIAL(j) )
_mesa_update_color_material( ctx, (GLchan *)CMcolor[j] );
-
+
if ( CHECK_MATERIAL(j) )
_mesa_update_material( ctx, new_material[j], new_material_mask[j] );
_mesa_validate_all_lighting_tables( ctx );
COPY_3V(sum[0], base[0]);
-
- if ( IDX & LIGHT_TWOSIDE )
+
+ if ( IDX & LIGHT_TWOSIDE )
COPY_3V(sum[1], base[1]);
-
+
/* Add contribution from each enabled light source */
foreach (light, &ctx->Light.EnabledList) {
GLfloat n_dot_h;
GLfloat correction;
- GLint side;
+ GLint side;
GLfloat contrib[3];
GLfloat attenuation = 1.0;
GLfloat VP[3]; /* unit vector from vertex to light */
SELF_SCALE_SCALAR_3V(VP, invd);
}
- attenuation = 1.0F / (light->ConstantAttenuation + d *
- (light->LinearAttenuation + d *
+ attenuation = 1.0F / (light->ConstantAttenuation + d *
+ (light->LinearAttenuation + d *
light->QuadraticAttenuation));
/* spotlight attenuation */
}
}
-
- if (attenuation < 1e-3)
+
+ if (attenuation < 1e-3)
continue; /* this light makes no contribution */
ACC_SCALE_SCALAR_3V(sum[0], attenuation, light->_MatAmbient[0]);
if (!(IDX & LIGHT_TWOSIDE))
- continue;
+ continue;
side = 1;
correction = -1;
else {
if (IDX & LIGHT_TWOSIDE) {
ACC_SCALE_SCALAR_3V( sum[1], attenuation, light->_MatAmbient[1]);
- }
+ }
side = 0;
correction = 1;
- }
-
+ }
+
COPY_3V(contrib, light->_MatAmbient[side]);
/* diffuse term */
else {
h = light->_h_inf_norm;
}
-
+
n_dot_h = correction * DOT3(normal, h);
- if (n_dot_h > 0.0F)
+ if (n_dot_h > 0.0F)
{
GLfloat spec_coef;
struct gl_shine_tab *tab = ctx->_ShineTable[side];
-
+
GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec_coef );
ACC_SCALE_SCALAR_3V( contrib, spec_coef,
}
ACC_SCALE_SCALAR_3V( sum[side], attenuation, contrib );
- }
+ }
UNCLAMPED_FLOAT_TO_RGB_CHAN( Fcolor[j], sum[0] );
Fcolor[j][3] = sumA[0];
UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
Bcolor[j][3] = sumA[1];
}
- }
+ }
}
/* As below, but with just a single light.
*/
-static void TAG(light_fast_rgba_single)( GLcontext *ctx,
+static void TAG(light_fast_rgba_single)( GLcontext *ctx,
struct vertex_buffer *VB,
struct gl_pipeline_stage *stage,
GLvector4f *input )
{
struct light_stage_data *store = LIGHT_STAGE_DATA(stage);
- GLuint nstride = VB->NormalPtr->stride;
+ GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLchan (*CMcolor)[4];
GLuint CMstride;
(void) input; /* doesn't refer to Eye or Obj */
(void) flags;
(void) nr;
- (void) nstride;
+ (void) nstride;
if (IDX & LIGHT_COLORMATERIAL) {
CMcolor = VB->ColorPtr[0]->data;
do {
- if ( CHECK_COLOR_MATERIAL(j) )
+ if ( CHECK_COLOR_MATERIAL(j) )
_mesa_update_color_material( ctx, (GLchan *)CMcolor[j] );
-
- if ( CHECK_MATERIAL(j) )
+
+ if ( CHECK_MATERIAL(j) )
_mesa_update_material( ctx, new_material[j], new_material_mask[j] );
if ( CHECK_VALIDATE(j) )
COPY_3V(base[0], light->_MatAmbient[0]);
ACC_3V(base[0], ctx->Light._BaseColor[0] );
UNCLAMPED_FLOAT_TO_RGB_CHAN( baseubyte[0], base[0] );
-
+
if (IDX & LIGHT_TWOSIDE) {
COPY_3V(base[1], light->_MatAmbient[1]);
ACC_3V(base[1], ctx->Light._BaseColor[1]);
}
}
- do {
+ do {
GLfloat n_dot_VP = DOT3(normal, light->_VP_inf_norm);
-
+
COPY_CHAN4(Fcolor[j], baseubyte[0]);
if (IDX & LIGHT_TWOSIDE) COPY_CHAN4(Bcolor[j], baseubyte[1]);
GLfloat spec;
GET_SHINE_TAB_ENTRY( ctx->_ShineTable[1], n_dot_h, spec );
ACC_SCALE_SCALAR_3V(sum, spec, light->_MatSpecular[1]);
- }
+ }
UNCLAMPED_FLOAT_TO_RGB_CHAN(Bcolor[j], sum );
}
} else {
COPY_3V(sum, base[0]);
ACC_SCALE_SCALAR_3V(sum, n_dot_VP, light->_MatDiffuse[0]);
if (n_dot_h > 0.0F) {
- GLfloat spec;
+ GLfloat spec;
GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec );
ACC_SCALE_SCALAR_3V(sum, spec, light->_MatSpecular[0]);
STRIDE_F(normal, NSTRIDE);
} while (DO_ANOTHER_NORMAL(j));
-
+
for ( ; REUSE_LIGHT_RESULTS(j) ; j++ ) {
COPY_CHAN4(Fcolor[j], Fcolor[j-1]);
- if (IDX & LIGHT_TWOSIDE)
+ if (IDX & LIGHT_TWOSIDE)
COPY_CHAN4(Bcolor[j], Bcolor[j-1]);
STRIDE_F(normal, NSTRIDE);
}
} while (!CHECK_END_VB(j));
-}
+}
/* Light infinite lights
*/
-static void TAG(light_fast_rgba)( GLcontext *ctx,
+static void TAG(light_fast_rgba)( GLcontext *ctx,
struct vertex_buffer *VB,
struct gl_pipeline_stage *stage,
GLvector4f *input )
{
struct light_stage_data *store = LIGHT_STAGE_DATA(stage);
const GLchan *sumA = ctx->Light._BaseAlpha;
- GLuint nstride = VB->NormalPtr->stride;
+ GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLchan (*CMcolor)[4];
GLuint CMstride;
(void) flags;
(void) input;
(void) nr;
- (void) nstride;
+ (void) nstride;
if (IDX & LIGHT_COLORMATERIAL) {
CMcolor = VB->ColorPtr[0]->data;
do {
GLfloat sum[2][3];
- if ( CHECK_COLOR_MATERIAL(j) )
+ if ( CHECK_COLOR_MATERIAL(j) )
_mesa_update_color_material( ctx, CMcolor[j] );
- if ( CHECK_MATERIAL(j) )
+ if ( CHECK_MATERIAL(j) )
_mesa_update_material( ctx, new_material[j], new_material_mask[j] );
if ( CHECK_VALIDATE(j) )
COPY_3V(sum[0], ctx->Light._BaseColor[0]);
- if (IDX & LIGHT_TWOSIDE)
+ if (IDX & LIGHT_TWOSIDE)
COPY_3V(sum[1], ctx->Light._BaseColor[1]);
foreach (light, &ctx->Light.EnabledList) {
GLfloat n_dot_h, n_dot_VP, spec;
ACC_3V(sum[0], light->_MatAmbient[0]);
- if (IDX & LIGHT_TWOSIDE)
+ if (IDX & LIGHT_TWOSIDE)
ACC_3V(sum[1], light->_MatAmbient[1]);
n_dot_VP = DOT3(normal, light->_VP_inf_norm);
if (n_dot_h > 0.0F) {
struct gl_shine_tab *tab = ctx->_ShineTable[0];
GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec );
- ACC_SCALE_SCALAR_3V( sum[0], spec,
+ ACC_SCALE_SCALAR_3V( sum[0], spec,
light->_MatSpecular[0]);
- }
+ }
}
else if (IDX & LIGHT_TWOSIDE) {
ACC_SCALE_SCALAR_3V(sum[1], -n_dot_VP, light->_MatDiffuse[1]);
if (n_dot_h > 0.0F) {
struct gl_shine_tab *tab = ctx->_ShineTable[1];
GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec );
- ACC_SCALE_SCALAR_3V( sum[1], spec,
+ ACC_SCALE_SCALAR_3V( sum[1], spec,
light->_MatSpecular[1]);
- }
+ }
}
}
UNCLAMPED_FLOAT_TO_RGB_CHAN( Fcolor[j], sum[0] );
Fcolor[j][3] = sumA[0];
-
+
if (IDX & LIGHT_TWOSIDE) {
UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
Bcolor[j][3] = sumA[1];
}
} while (!CHECK_END_VB(j));
-}
+}
* normal - array of [n] surface normal vector
* Output: indexResult - resulting array of [n] color indexes
*/
-static void TAG(light_ci)( GLcontext *ctx,
+static void TAG(light_ci)( GLcontext *ctx,
struct vertex_buffer *VB,
struct gl_pipeline_stage *stage,
GLvector4f *input )
GLuint j;
GLuint vstride = input->stride;
const GLfloat *vertex = (GLfloat *) input->data;
- GLuint nstride = VB->NormalPtr->stride;
+ GLuint nstride = VB->NormalPtr->stride;
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
GLchan (*CMcolor)[4];
GLuint CMstride;
/* fprintf(stderr, "%s\n", __FUNCTION__ ); */
(void) flags;
- (void) nstride;
+ (void) nstride;
(void) vstride;
VB->IndexPtr[0] = &store->LitIndex[0];
}
/* loop over vertices */
- for ( j=0 ;
- j<nr ;
- j++,STRIDE_F(vertex,VSTRIDE),STRIDE_F(normal, NSTRIDE), CMSTRIDE)
+ for ( j=0 ;
+ j<nr ;
+ j++,STRIDE_F(vertex,VSTRIDE),STRIDE_F(normal, NSTRIDE), CMSTRIDE)
{
GLfloat diffuse[2], specular[2];
GLuint side = 0;
struct gl_light *light;
-
- if ( CHECK_COLOR_MATERIAL(j) )
+
+ if ( CHECK_COLOR_MATERIAL(j) )
_mesa_update_color_material( ctx, (GLchan *)CMcolor[j] );
-
+
if ( CHECK_MATERIAL(j) )
_mesa_update_material( ctx, new_material[j], new_material_mask[j] );
}
else {
GLfloat d; /* distance from vertex to light */
-
+
SUB_3V(VP, light->_Position, vertex);
d = LEN_3FV( VP );
SELF_SCALE_SCALAR_3V(VP, invd);
}
- attenuation = 1.0F / (light->ConstantAttenuation + d *
- (light->LinearAttenuation + d *
+ attenuation = 1.0F / (light->ConstantAttenuation + d *
+ (light->LinearAttenuation + d *
light->QuadraticAttenuation));
/* spotlight attenuation */
}
}
- if (attenuation < 1e-3)
+ if (attenuation < 1e-3)
continue; /* this light makes no contribution */
n_dot_VP = DOT3( normal, VP );
/* which side are we lighting? */
if (n_dot_VP < 0.0F) {
- if (!(IDX & LIGHT_TWOSIDE))
+ if (!(IDX & LIGHT_TWOSIDE))
continue;
side = 1;
correction = -1;
else {
GLfloat d_a = mat->DiffuseIndex - mat->AmbientIndex;
GLfloat s_a = mat->SpecularIndex - mat->AmbientIndex;
-
+
index = mat->AmbientIndex
+ diffuse[side] * (1.0F-specular[side]) * d_a
+ specular[side] * s_a;
#undef TAG
-#undef IDX
+#undef IDX
#undef NR_SIDES
#undef NSTRIDE
#undef VSTRIDE
-/* $Id: t_vb_normals.c,v 1.6 2001/03/07 05:06:13 brianp Exp $ */
+/* $Id: t_vb_normals.c,v 1.7 2001/03/12 00:48:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
struct normal_stage_data {
- normal_func *NormalTransform;
+ normal_func *NormalTransform;
GLvector3f normal;
};
-static GLboolean run_normal_stage( GLcontext *ctx,
+static GLboolean run_normal_stage( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
struct normal_stage_data *store = NORMAL_STAGE_DATA(stage);
(store->NormalTransform[0])(&ctx->ModelView,
ctx->_ModelViewInvScale,
VB->NormalPtr,
- 0,
+ 0,
0,
&store->normal);
}
-static GLboolean run_validate_normal_stage( GLcontext *ctx,
+static GLboolean run_validate_normal_stage( GLcontext *ctx,
struct gl_pipeline_stage *stage)
{
struct normal_stage_data *store = NORMAL_STAGE_DATA(stage);
MAT_FLAG_GENERAL_3D |
MAT_FLAG_PERSPECTIVE))
transform = NORM_TRANSFORM;
-
-
+
+
if (ctx->Transform.Normalize) {
store->NormalTransform = _mesa_normal_tab[transform | NORM_NORMALIZE];
}
stage->active = ctx->_NeedNormals;
/* Don't clobber the initialize function:
*/
- if (stage->privatePtr)
+ if (stage->privatePtr)
stage->run = run_validate_normal_stage;
}
-static GLboolean alloc_normal_data( GLcontext *ctx,
+static GLboolean alloc_normal_data( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
-const struct gl_pipeline_stage _tnl_normal_transform_stage =
-{
+const struct gl_pipeline_stage _tnl_normal_transform_stage =
+{
"normal transform",
_TNL_NEW_NORMAL_TRANSFORM, /* re-check */
_TNL_NEW_NORMAL_TRANSFORM, /* re-run */
check_normal_transform, /* check */
alloc_normal_data /* run -- initially set to alloc */
};
-
-/* $Id: t_vb_points.c,v 1.3 2001/03/07 05:06:13 brianp Exp $ */
+/* $Id: t_vb_points.c,v 1.4 2001/03/12 00:48:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Brian Paul <brian@valinux.com>
*/
struct point_stage_data {
- GLvector1f PointSize;
+ GLvector1f PointSize;
};
#define POINT_STAGE_DATA(stage) ((struct point_stage_data *)stage->privatePtr)
/*
* Compute attenuated point sizes
*/
-static GLboolean run_point_stage( GLcontext *ctx,
+static GLboolean run_point_stage( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
struct point_stage_data *store = POINT_STAGE_DATA(stage);
}
VB->PointSizePtr = &store->PointSize;
-
+
return GL_TRUE;
}
}
}
-const struct gl_pipeline_stage _tnl_point_attenuation_stage =
-{
+const struct gl_pipeline_stage _tnl_point_attenuation_stage =
+{
"point size attenuation", /* name */
_NEW_POINT, /* build_state_change */
_NEW_POINT, /* run_state_change */
-/* $Id: t_vb_render.c,v 1.14 2001/02/16 18:14:42 keithw Exp $ */
+/* $Id: t_vb_render.c,v 1.15 2001/03/12 00:48:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
* context->Driver.PointsFunc()
* context->Driver.LineFunc()
* context->Driver.TriangleFunc()
- * context->Driver.QuadFunc()
+ * context->Driver.QuadFunc()
*
- * context->Driver.RenderTabVerts[]
+ * context->Driver.RenderTabVerts[]
* context->Driver.RenderTabElts[]
*
* None of these may be null.
/**********************************************************************/
-#if defined(USE_IEEE)
+#if defined(USE_IEEE)
#define NEGATIVE(x) ((*(GLuint *)&x) & (1<<31))
#define DIFFERENT_SIGNS(x,y) (((*(GLuint *)&x)^(*(GLuint *)&y)) & (1<<31))
#else
const GLuint * const elt = VB->Elts;
GLubyte *mask = VB->ClipMask;
(void) flags;
-
+
ctx->Driver.RenderPrimitive( ctx, GL_TRIANGLES );
for (j=start; j < last; j+=3 ) {
GLubyte c3 = mask[elt[j+2]];
GLubyte ormask = c1|c2|c3;
if (ormask) {
- if (start < j)
+ if (start < j)
render_tris( ctx, start, j, 0 );
- if (!(c1&c2&c3&0x3f))
+ if (!(c1&c2&c3&0x3f))
clip_tri_4( ctx, elt[j], elt[j+1], elt[j+2], ormask );
start = j+3;
}
}
- if (start < j)
+ if (start < j)
render_tris( ctx, start, j, 0 );
}
#define RESET_STIPPLE ctx->Driver.ResetLineStipple( ctx )
#define RESET_OCCLUSION ctx->OcclusionResult = GL_TRUE
#define INIT(x) ctx->Driver.RenderPrimitive( ctx, x )
-#define RENDER_TAB_QUALIFIER
+#define RENDER_TAB_QUALIFIER
#define PRESERVE_VB_DEFS
#include "t_vb_rendertmp.h"
struct gl_pipeline_stage *stage )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
+ struct vertex_buffer *VB = &tnl->vb;
GLuint new_inputs = stage->changed_inputs;
render_func *tab;
GLint pass = 0;
}
else {
tab = VB->Elts ? ctx->Driver.RenderTabElts : ctx->Driver.RenderTabVerts;
- }
+ }
do
{
for (i = 0 ; !(flags & PRIM_LAST) ; i += length)
{
flags = VB->Primitive[i];
- length= VB->PrimitiveLength[i];
+ length= VB->PrimitiveLength[i];
ASSERT(length || (flags & PRIM_LAST));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
/* Quite a bit of work involved in finding out the inputs for the
- * render stage.
+ * render stage.
*/
static void check_render( GLcontext *ctx, struct gl_pipeline_stage *stage )
{
if (ctx->Visual.rgbMode) {
inputs |= VERT_RGBA;
- if (ctx->_TriangleCaps & DD_SEPERATE_SPECULAR)
+ if (ctx->_TriangleCaps & DD_SEPERATE_SPECULAR)
inputs |= VERT_SPEC_RGB;
if (ctx->Texture._ReallyEnabled) {
inputs |= VERT_INDEX;
}
- if (ctx->Point._Attenuated)
+ if (ctx->Point._Attenuated)
inputs |= VERT_POINT_SIZE;
/* How do drivers turn this off?
*/
- if (ctx->Fog.Enabled)
+ if (ctx->Fog.Enabled)
inputs |= VERT_FOG_COORD;
- if (ctx->_TriangleCaps & DD_TRI_UNFILLED)
+ if (ctx->_TriangleCaps & DD_TRI_UNFILLED)
inputs |= VERT_EDGE;
- if (ctx->RenderMode==GL_FEEDBACK)
+ if (ctx->RenderMode==GL_FEEDBACK)
inputs |= VERT_TEX_ANY;
stage->inputs = inputs;
}
-const struct gl_pipeline_stage _tnl_render_stage =
-{
+const struct gl_pipeline_stage _tnl_render_stage =
+{
"render",
(_NEW_BUFFERS |
_DD_NEW_SEPERATE_SPECULAR |
-/* $Id: t_vb_rendertmp.h,v 1.7 2001/01/16 05:29:43 keithw Exp $ */
+/* $Id: t_vb_rendertmp.h,v 1.8 2001/03/12 00:48:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
#endif
#ifndef INIT
-#define INIT(x)
+#define INIT(x)
#endif
#ifndef NEED_EDGEFLAG_SETUP
#define NEED_EDGEFLAG_SETUP 0
#define EDGEFLAG_GET(a) 0
-#define EDGEFLAG_SET(a,b) (void)b
+#define EDGEFLAG_SET(a,b) (void)b
#endif
#ifndef RESET_STIPPLE
RESET_OCCLUSION;
INIT(GL_LINE_STRIP);
- for (j=start+1; j<count; j++ )
+ for (j=start+1; j<count; j++ )
RENDER_LINE( ELT(j-1), ELT(j) );
if (TEST_PRIM_END(flags))
GLuint count,
GLuint flags )
{
- GLuint i;
+ GLuint i;
LOCAL_VARS;
(void) flags;
GLuint j;
GLuint parity = 0;
LOCAL_VARS;
-
+
if (TEST_PRIM_PARITY(flags))
parity = 1;
-
+
INIT(GL_TRIANGLE_STRIP);
if (NEED_EDGEFLAG_SETUP) {
for (j=start+2;j<count;j++,parity^=1) {
/* If the primitive does not begin here, the first edge
* is non-boundary.
*/
- if (!TEST_PRIM_BEGIN(flags))
+ if (!TEST_PRIM_BEGIN(flags))
EDGEFLAG_SET( ELT(start), GL_FALSE );
/* If the primitive does not end here, the final edge is
* non-boundary.
*/
- if (!TEST_PRIM_END(flags))
+ if (!TEST_PRIM_END(flags))
EDGEFLAG_SET( ELT(count-1), GL_FALSE );
/* Draw the first triangles (possibly zero)
RENDER_TRI( ELT(j-1), ELT(j), ELT(start) );
EDGEFLAG_SET( ELT(j), ef );
j++;
-
+
/* Don't render the first edge again:
*/
EDGEFLAG_SET( ELT(start), GL_FALSE );
*/
EDGEFLAG_SET( ELT(count-1), efcount );
EDGEFLAG_SET( ELT(start), efstart );
-
+
if (TEST_PRIM_END(flags)) {
RESET_STIPPLE;
}
}
}
POSTFIX;
-}
+}
static void TAG(render_quad_strip)( GLcontext *ctx,
GLuint start,
RENDER_TAB_QUALIFIER void (*TAG(render_tab)[GL_POLYGON+2])(GLcontext *,
GLuint,
GLuint,
- GLuint) =
+ GLuint) =
{
TAG(render_points),
TAG(render_lines),
#undef PRESERVE_VB_DEFS
#undef PRESERVE_TAG
-
-/* $Id: t_vb_texgen.c,v 1.5 2001/03/07 05:06:13 brianp Exp $ */
+/* $Id: t_vb_texgen.c,v 1.6 2001/03/12 00:48:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#define VEC_SIZE_FLAGS (VEC_SIZE_1|VEC_SIZE_2|VEC_SIZE_3|VEC_SIZE_4)
-/*
+/*
*/
static void build_m3(GLfloat f[][3], GLfloat m[],
- const GLvector3f *normal,
+ const GLvector3f *normal,
const GLvector4f *eye )
{
GLuint stride = eye->stride;
/* KW: Had to rearrange this loop to avoid a compiler bug with gcc
* 2.7.3.1 at -O3 optimization. Using -fno-strength-reduce
- * also fixed the bug - is this generally necessary?
+ * also fixed the bug - is this generally necessary?
*/
for (i=0;i<count;i++,STRIDE_F(coord,stride)) {
GLfloat u[3], two_nu, fx, fy, fz;
- COPY_3V( u, coord );
+ COPY_3V( u, coord );
NORMALIZE_3FV( u );
two_nu = 2.0F * DOT3(norm,u);
fx = f[i][0] = u[0] - norm[0] * two_nu;
static void build_m2(GLfloat f[][3], GLfloat m[],
- const GLvector3f *normal,
+ const GLvector3f *normal,
const GLvector4f *eye )
{
GLuint stride = eye->stride;
for (i=0;i<count;i++,STRIDE_F(coord,stride)) {
GLfloat u[3], two_nu, fx, fy, fz;
- COPY_2V( u, coord );
+ COPY_2V( u, coord );
u[2] = 0;
NORMALIZE_3FV( u );
two_nu = 2.0F * DOT3(norm,u);
/* This is unusual in that we respect the stride of the output vector
* (f). This allows us to pass in either a texcoord vector4f, or a
- * temporary vector3f.
+ * temporary vector3f.
*/
-static void build_f3( GLfloat *f,
+static void build_f3( GLfloat *f,
GLuint fstride,
const GLvector3f *normal,
const GLvector4f *eye )
for (i=0;i<count;i++) {
GLfloat u[3], two_nu;
- COPY_3V( u, coord );
+ COPY_3V( u, coord );
NORMALIZE_3FV( u );
two_nu = 2.0F * DOT3(norm,u);
f[0] = u[0] - norm[0] * two_nu;
f[1] = u[1] - norm[1] * two_nu;
f[2] = u[2] - norm[2] * two_nu;
STRIDE_F(coord,stride);
- STRIDE_F(f,fstride);
+ STRIDE_F(f,fstride);
STRIDE_F(norm, normal->stride);
}
}
-static void build_f2( GLfloat *f,
+static void build_f2( GLfloat *f,
GLuint fstride,
const GLvector3f *normal,
const GLvector4f *eye )
for (i=0;i<count;i++) {
GLfloat u[3], two_nu;
- COPY_2V( u, coord );
+ COPY_2V( u, coord );
u[2] = 0;
NORMALIZE_3FV( u );
two_nu = 2.0F * DOT3(norm,u);
-/* Just treat 4-vectors as 3-vectors.
+/* Just treat 4-vectors as 3-vectors.
*/
static build_f_func build_f_tab[5] = {
0,
0,
build_f2,
build_f3,
- build_f3
+ build_f3
};
build_f_tab[VB->EyePtr->size]( out->start,
out->stride,
- VB->NormalPtr,
- VB->EyePtr );
-
+ VB->NormalPtr,
+ VB->EyePtr );
+
if (in) {
out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3;
out->count = in->count;
out->size = MAX2(in->size, 3);
- if (in->size == 4)
+ if (in->size == 4)
_mesa_copy_tab[0][0x8](out, in, 0);
- }
+ }
else {
out->flags |= VEC_SIZE_3;
out->size = 3;
out->count = in->count;
}
-
+
}
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLvector4f *in = VB->TexCoordPtr[unit];
GLvector4f *out = &store->texcoord[unit];
- GLvector3f *normal = VB->NormalPtr;
+ GLvector3f *normal = VB->NormalPtr;
GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->start;
GLuint count = VB->Count;
GLuint i;
out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3;
out->count = in->count;
out->size = MAX2(in->size, 3);
- if (in->size == 4)
+ if (in->size == 4)
_mesa_copy_tab[0][0x8](out, in, 0);
- }
+ }
else {
out->flags |= VEC_SIZE_3;
out->size = 3;
GLfloat (*f)[3] = store->tmp_f;
GLfloat *m = store->tmp_m;
- (build_m_tab[VB->EyePtr->size])( store->tmp_f,
- store->tmp_m,
- VB->NormalPtr,
- VB->EyePtr );
+ (build_m_tab[VB->EyePtr->size])( store->tmp_f,
+ store->tmp_m,
+ VB->NormalPtr,
+ VB->EyePtr );
for (i=0;i<count;i++) {
texcoord[i][0] = f[i][0] * m[i] + 0.5F;
out->size = MAX2(in->size,2);
out->count = in->count;
out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_2;
- if (in->size > 2)
+ if (in->size > 2)
_mesa_copy_tab[0][all_bits[in->size] & ~0x3](out, in, 0);
} else {
out->size = 2;
-static void texgen( GLcontext *ctx,
+static void texgen( GLcontext *ctx,
struct texgen_stage_data *store,
GLuint unit )
{
if (texUnit->_GenFlags & TEXGEN_NEED_M) {
- build_m_tab[in->size]( store->tmp_f, store->tmp_m, normal, eye );
+ build_m_tab[in->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[in->size]( (GLfloat *)store->tmp_f, 3, normal, eye );
}
if (!in) {
out->size = MAX2(in->size, store->TexgenSize[unit]);
out->flags |= (in->flags & VEC_SIZE_FLAGS) | texUnit->TexGenEnabled;
out->count = in->count;
-
+
holes = ~all_bits[in->size] & store->TexgenHoles[unit];
}
switch (texUnit->GenModeS) {
case GL_OBJECT_LINEAR:
(_mesa_dotprod_tab[0][obj->size])((GLfloat *)out->data,
- sizeof(out->data[0]), obj,
+ sizeof(out->data[0]), obj,
texUnit->ObjectPlaneS, 0);
break;
case GL_EYE_LINEAR:
- (_mesa_dotprod_tab[0][eye->size])((GLfloat *)out->data,
+ (_mesa_dotprod_tab[0][eye->size])((GLfloat *)out->data,
sizeof(out->data[0]), eye,
texUnit->EyePlaneS, 0);
break;
- case GL_SPHERE_MAP:
+ 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;
break;
- case GL_REFLECTION_MAP_NV:
- for (i=0;i<count;i++)
+ case GL_REFLECTION_MAP_NV:
+ for (i=0;i<count;i++)
texcoord[i][0] = f[i][0];
break;
case GL_NORMAL_MAP_NV: {
default:
_mesa_problem(ctx, "Bad S texgen");
}
- }
+ }
if (texUnit->TexGenEnabled & T_BIT) {
GLuint i;
switch (texUnit->GenModeT) {
case GL_OBJECT_LINEAR:
- (_mesa_dotprod_tab[0][obj->size])(&(out->data[0][1]),
- sizeof(out->data[0]), obj,
+ (_mesa_dotprod_tab[0][obj->size])(&(out->data[0][1]),
+ sizeof(out->data[0]), obj,
texUnit->ObjectPlaneT, 0);
break;
case GL_EYE_LINEAR:
- (_mesa_dotprod_tab[0][eye->size])(&(out->data[0][1]),
- sizeof(out->data[0]), eye,
+ (_mesa_dotprod_tab[0][eye->size])(&(out->data[0][1]),
+ sizeof(out->data[0]), eye,
texUnit->EyePlaneT, 0);
- break;
- case GL_SPHERE_MAP:
- for (indata=in->start,i=0; i<count ;i++,STRIDE_F(indata,in->stride))
+ 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;
- break;
- case GL_REFLECTION_MAP_NV:
- for (i=0;i<count;i++)
+ break;
+ case GL_REFLECTION_MAP_NV:
+ for (i=0;i<count;i++)
texcoord[i][0] = f[i][0];
break;
case GL_NORMAL_MAP_NV: {
GLuint i;
switch (texUnit->GenModeR) {
case GL_OBJECT_LINEAR:
- (_mesa_dotprod_tab[0][obj->size])(&(out->data[0][2]),
- sizeof(out->data[0]), obj,
+ (_mesa_dotprod_tab[0][obj->size])(&(out->data[0][2]),
+ sizeof(out->data[0]), obj,
texUnit->ObjectPlaneR, 0);
break;
case GL_EYE_LINEAR:
- (_mesa_dotprod_tab[0][eye->size])(&(out->data[0][2]),
+ (_mesa_dotprod_tab[0][eye->size])(&(out->data[0][2]),
sizeof(out->data[0]), eye,
texUnit->EyePlaneR, 0);
break;
- case GL_REFLECTION_MAP_NV:
- for (i=0;i<count;i++)
+ case GL_REFLECTION_MAP_NV:
+ for (i=0;i<count;i++)
texcoord[i][2] = f[i][2];
break;
case GL_NORMAL_MAP_NV: {
if (texUnit->TexGenEnabled & Q_BIT) {
switch (texUnit->GenModeQ) {
case GL_OBJECT_LINEAR:
- (_mesa_dotprod_tab[0][obj->size])(&(out->data[0][3]),
- sizeof(out->data[0]), obj,
+ (_mesa_dotprod_tab[0][obj->size])(&(out->data[0][3]),
+ sizeof(out->data[0]), obj,
texUnit->ObjectPlaneQ, 0);
break;
case GL_EYE_LINEAR:
- (_mesa_dotprod_tab[0][eye->size])(&(out->data[0][3]),
+ (_mesa_dotprod_tab[0][eye->size])(&(out->data[0][3]),
sizeof(out->data[0]), eye,
texUnit->EyePlaneQ, 0);
break;
-static GLboolean run_texgen_stage( GLcontext *ctx,
+static GLboolean run_texgen_stage( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
struct texgen_stage_data *store = TEXGEN_STAGE_DATA( stage );
GLuint i;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if (ctx->_Enabled & ENABLE_TEXGEN(i)) {
if (stage->changed_inputs & (VERT_EYE | VERT_NORM | VERT_TEX(i)))
store->TexgenFunc[i]( ctx, store, i );
-static GLboolean run_validate_texgen_stage( GLcontext *ctx,
+static GLboolean run_validate_texgen_stage( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage);
sz = 2;
else
sz = 1;
-
+
store->TexgenSize[i] = sz;
store->TexgenHoles[i] = (all_bits[sz] & ~texUnit->TexGenEnabled);
store->TexgenFunc[i] = texgen;
-
+
if (texUnit->TexGenEnabled == (S_BIT|T_BIT|R_BIT)) {
if (texUnit->_GenFlags == TEXGEN_REFLECTION_MAP_NV) {
store->TexgenFunc[i] = texgen_reflection_map_nv;
if (ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS)
inputs |= VERT_NORM;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
- if (ctx->_Enabled & ENABLE_TEXGEN(i))
+ for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ if (ctx->_Enabled & ENABLE_TEXGEN(i))
{
outputs |= VERT_TEX(i);
stage->outputs = outputs;
}
}
-
+
/* Called the first time stage->run() is invoked.
*/
-static GLboolean alloc_texgen_data( GLcontext *ctx,
+static GLboolean alloc_texgen_data( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
struct texgen_stage_data *store;
GLuint i;
if (store) {
for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++)
- if (store->texcoord[i].data)
+ if (store->texcoord[i].data)
_mesa_vector4f_free( &store->texcoord[i] );
-
+
if (store->tmp_f) FREE( store->tmp_f );
if (store->tmp_m) FREE( store->tmp_m );
FREE( store );
}
-
-const struct gl_pipeline_stage _tnl_texgen_stage =
-{
+
+const struct gl_pipeline_stage _tnl_texgen_stage =
+{
"texgen",
_NEW_TEXTURE, /* when to call check() */
_NEW_TEXTURE, /* when to invalidate stored data */
check_texgen, /* check */
alloc_texgen_data /* run -- initially set to alloc data */
};
-
-
-/* $Id: t_vb_texmat.c,v 1.3 2001/03/07 05:06:13 brianp Exp $ */
+/* $Id: t_vb_texmat.c,v 1.4 2001/03/12 00:48:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
/* Is there any real benefit seperating texmat from texgen? It means
* we need two lots of intermediate storage. Any changes to
* _NEW_TEXTURE will invalidate both sets -- it's only on changes to
- * *only* _NEW_TEXTURE_MATRIX that texgen survives but texmat doesn't.
+ * *only* _NEW_TEXTURE_MATRIX that texgen survives but texmat doesn't.
*
* However, the seperation of this code from the complex texgen stuff
* is very appealing.
if (ctx->_Enabled & ENABLE_TEXMAT_ANY) {
GLuint flags = 0;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
- if (ctx->_Enabled & ENABLE_TEXMAT(i))
+ for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ if (ctx->_Enabled & ENABLE_TEXMAT(i))
flags |= VERT_TEX(i);
-
+
stage->active = 1;
stage->inputs = flags;
stage->outputs = flags;
}
}
-static GLboolean run_texmat_stage( GLcontext *ctx,
+static GLboolean run_texmat_stage( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
struct texmat_stage_data *store = TEXMAT_STAGE_DATA(stage);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLuint i;
/* ENABLE_TEXMAT implies that the texture matrix is not the
* identity, so we don't have to check that here.
*/
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if (ctx->_Enabled & ENABLE_TEXMAT(i)) {
if (stage->changed_inputs & VERT_TEX(i))
(void) TransformRaw( &store->texcoord[i], &ctx->TextureMatrix[i],
/* Called the first time stage->run() is invoked.
*/
-static GLboolean alloc_texmat_data( GLcontext *ctx,
+static GLboolean alloc_texmat_data( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
struct texmat_stage_data *store;
GLuint i;
stage->privatePtr = 0;
}
}
-
-const struct gl_pipeline_stage _tnl_texture_transform_stage =
-{
+
+const struct gl_pipeline_stage _tnl_texture_transform_stage =
+{
"texture transform",
_NEW_TEXTURE|_NEW_TEXTURE_MATRIX,
_NEW_TEXTURE|_NEW_TEXTURE_MATRIX,
-/* $Id: t_vb_vertex.c,v 1.6 2001/03/07 05:06:13 brianp Exp $ */
+/* $Id: t_vb_vertex.c,v 1.7 2001/03/12 00:48:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
struct vertex_stage_data {
GLvector4f eye;
GLvector4f clip;
- GLvector4f proj;
+ GLvector4f proj;
GLubyte *clipmask;
GLubyte ormask;
GLubyte andmask;
/* This function implements cliptesting for user-defined clip planes.
* The clipping of primitives to these planes is implemented in
- * t_render_clip.h.
+ * t_render_clip.h.
*/
#define USER_CLIPTEST(NAME, SZ) \
static void NAME( GLcontext *ctx, \
}
-USER_CLIPTEST(userclip2, 2)
-USER_CLIPTEST(userclip3, 3)
-USER_CLIPTEST(userclip4, 4)
+USER_CLIPTEST(userclip2, 2)
+USER_CLIPTEST(userclip3, 3)
+USER_CLIPTEST(userclip4, 4)
static void (*(usercliptab[5]))( GLcontext *,
GLvector4f *, GLubyte *,
- GLubyte *, GLubyte * ) =
+ GLubyte *, GLubyte * ) =
{
0,
0,
-static GLboolean run_vertex_stage( GLcontext *ctx,
+static GLboolean run_vertex_stage( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
struct vertex_stage_data *store = (struct vertex_stage_data *)stage->privatePtr;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
-
- if (stage->changed_inputs)
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+
+ if (stage->changed_inputs)
{
/* VB->ObjPtr->size = 4; */
if (ctx->ModelView.type == MATRIX_IDENTITY)
VB->EyePtr = VB->ObjPtr;
else
- VB->EyePtr = TransformRaw( &store->eye, &ctx->ModelView,
+ VB->EyePtr = TransformRaw( &store->eye, &ctx->ModelView,
VB->ObjPtr);
if (ctx->ProjectionMatrix.type == MATRIX_IDENTITY)
VB->ClipPtr = VB->EyePtr;
else
- VB->ClipPtr = TransformRaw( &store->clip, &ctx->ProjectionMatrix,
+ VB->ClipPtr = TransformRaw( &store->clip, &ctx->ProjectionMatrix,
VB->EyePtr );
- }
- else
+ }
+ else
{
/* Combined modelviewproject transform:
*/
- if (ctx->_ModelProjectMatrix.type == MATRIX_IDENTITY)
+ if (ctx->_ModelProjectMatrix.type == MATRIX_IDENTITY)
VB->ClipPtr = VB->ObjPtr;
else
VB->ClipPtr = TransformRaw( &store->clip, &ctx->_ModelProjectMatrix,
VB->import_data( ctx, VERT_OBJ, VEC_NOT_WRITEABLE );
VB->ClipPtr = VB->ObjPtr;
}
- if (VB->ClipPtr->size == 2)
+ if (VB->ClipPtr->size == 2)
_mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 2 );
_mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 3 );
}
/* Cliptest and perspective divide. Clip functions must clear
- * the clipmask.
+ * the clipmask.
*/
store->ormask = 0;
store->andmask = CLIP_ALL_BITS;
if (tnl->NeedProjCoords) {
- VB->ProjectedClipPtr =
+ VB->ProjectedClipPtr =
_mesa_clip_tab[VB->ClipPtr->size]( VB->ClipPtr,
&store->proj,
store->clipmask,
&store->andmask );
}
- if (store->andmask)
+ if (store->andmask)
return GL_FALSE;
if (store->andmask)
return GL_FALSE;
}
-
+
VB->ClipOrMask = store->ormask;
VB->ClipMask = store->clipmask;
store->save_eyeptr = VB->EyePtr;
store->save_clipptr = VB->ClipPtr;
store->save_projptr = VB->ProjectedClipPtr;
- }
+ }
else {
- /* Replay the sideeffects.
+ /* Replay the sideeffects.
*/
VB->EyePtr = store->save_eyeptr;
VB->ClipPtr = store->save_clipptr;
static void check_vertex( GLcontext *ctx, struct gl_pipeline_stage *stage )
{
- (void) ctx;
+ (void) ctx;
(void) stage;
}
-static GLboolean init_vertex_stage( GLcontext *ctx,
+static GLboolean init_vertex_stage( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
struct vertex_stage_data *store;
GLuint size = VB->Size;
store = VERTEX_STAGE_DATA(stage);
if (!store)
return GL_FALSE;
-
+
_mesa_vector4f_alloc( &store->eye, 0, size, 32 );
_mesa_vector4f_alloc( &store->clip, 0, size, 32 );
- _mesa_vector4f_alloc( &store->proj, 0, size, 32 );
+ _mesa_vector4f_alloc( &store->proj, 0, size, 32 );
store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 );
if (!store->clipmask ||
- !store->eye.data ||
- !store->clip.data ||
- !store->proj.data)
+ !store->eye.data ||
+ !store->clip.data ||
+ !store->proj.data)
return GL_FALSE;
/* Now run the stage.
}
-const struct gl_pipeline_stage _tnl_vertex_transform_stage =
-{
+const struct gl_pipeline_stage _tnl_vertex_transform_stage =
+{
"modelview/project/cliptest/divide",
0, /* re-check -- always on */
_NEW_MODELVIEW|
check_vertex, /* check */
init_vertex_stage /* run -- initially set to init */
};
-
-
+/* $Id: tnl.h,v 1.6 2001/03/12 00:48:44 gareth Exp $ */
+
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),