summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2000-11-24 10:25:05 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2000-11-24 10:25:05 +0000
commitad2ac216fa0cbebc36530bf9e5256e902710b892 (patch)
tree2b44b0129679558d0a1760bf94d75bcdbfe145ad /src/mesa/main
parent00608a79dce1ea5e274f35b0a1883f7b623b9d7a (diff)
Support for swappable t&l modules, including an example one in the FX
driver (enable with FX_ALLOW_VTXFMT=t).
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/Makefile.X1111
-rw-r--r--src/mesa/main/clip.c9
-rw-r--r--src/mesa/main/colormac.h4
-rw-r--r--src/mesa/main/context.c70
-rw-r--r--src/mesa/main/dd.h125
-rw-r--r--src/mesa/main/dlist.c278
-rw-r--r--src/mesa/main/enable.c4
-rw-r--r--src/mesa/main/light.c113
-rw-r--r--src/mesa/main/light.h14
-rw-r--r--src/mesa/main/macros.h4
-rw-r--r--src/mesa/main/matrix.c8
-rw-r--r--src/mesa/main/mtypes.h24
-rw-r--r--src/mesa/main/rastpos.c4
-rw-r--r--src/mesa/main/state.c217
-rw-r--r--src/mesa/main/texstate.c13
-rw-r--r--src/mesa/main/varray.c47
-rw-r--r--src/mesa/main/varray.h8
17 files changed, 269 insertions, 684 deletions
diff --git a/src/mesa/main/Makefile.X11 b/src/mesa/main/Makefile.X11
index acec47b09c..84384f4c81 100644
--- a/src/mesa/main/Makefile.X11
+++ b/src/mesa/main/Makefile.X11
@@ -1,4 +1,4 @@
-# $Id: Makefile.X11,v 1.33 2000/11/16 21:05:34 keithw Exp $
+# $Id: Makefile.X11,v 1.34 2000/11/24 10:25:05 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.5
@@ -21,6 +21,7 @@ LIBDIR = ../lib
CORE_SOURCES = \
+ tnl/t_vtxfmt.c \
tnl/t_bbox.c \
tnl/t_clip.c \
tnl/t_context.c \
@@ -31,7 +32,6 @@ CORE_SOURCES = \
tnl/t_fog.c \
tnl/t_light.c \
tnl/t_pipeline.c \
- tnl/t_rect.c \
tnl/t_shade.c \
tnl/t_stages.c \
tnl/t_texture.c \
@@ -39,10 +39,11 @@ CORE_SOURCES = \
tnl/t_varray.c \
tnl/t_vb.c \
tnl/t_vbcull.c \
- tnl/t_vbfill.c \
tnl/t_vbindirect.c \
tnl/t_vbrender.c \
tnl/t_vbxform.c \
+ api_loopback.c \
+ api_noop.c \
accum.c \
alpha.c \
attrib.c \
@@ -90,7 +91,6 @@ CORE_SOURCES = \
polygon.c \
rastpos.c \
readpix.c \
- rect.c \
scissor.c \
state.c \
stencil.c \
@@ -100,6 +100,7 @@ CORE_SOURCES = \
texture.c \
texutil.c \
varray.c \
+ vtxfmt.c \
winpos.c \
X86/x86.c \
X86/common_x86.c \
@@ -147,6 +148,8 @@ CORE_SOURCES = \
DRIVER_SOURCES = \
+ FX/fxvtxfmt.c \
+ FX/fxvtxprims.c \
FX/fxapi.c \
FX/fxdd.c \
FX/fxddspan.c \
diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c
index 2df12db2e5..0dc365131d 100644
--- a/src/mesa/main/clip.c
+++ b/src/mesa/main/clip.c
@@ -1,4 +1,4 @@
-/* $Id: clip.c,v 1.16 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: clip.c,v 1.17 2000/11/24 10:25:05 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -78,7 +78,7 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
* whenever the projection matrix changes.
*/
if (ctx->ModelView.flags & MAT_DIRTY)
- _math_matrix_analyze( &ctx->ModelView );
+ _math_matrix_analyse( &ctx->ModelView );
gl_transform_vector( ctx->Transform.EyeUserPlane[p], equation,
ctx->ModelView.inv );
@@ -90,7 +90,7 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
*/
if (ctx->Transform.ClipEnabled[p]) {
if (ctx->ProjectionMatrix.flags & MAT_DIRTY)
- _math_matrix_analyze( &ctx->ProjectionMatrix );
+ _math_matrix_analyse( &ctx->ProjectionMatrix );
gl_transform_vector( ctx->Transform._ClipUserPlane[p],
ctx->Transform.EyeUserPlane[p],
@@ -98,6 +98,9 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
}
ctx->NewState |= _NEW_TRANSFORM;
+
+ if (ctx->Driver.ClipPlane)
+ ctx->Driver.ClipPlane( ctx, plane, equation );
}
diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h
index 57d4350cc4..f0a7cc96b2 100644
--- a/src/mesa/main/colormac.h
+++ b/src/mesa/main/colormac.h
@@ -1,4 +1,4 @@
-/* $Id: colormac.h,v 1.3 2000/11/16 21:05:34 keithw Exp $ */
+/* $Id: colormac.h,v 1.4 2000/11/24 10:25:05 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -38,7 +38,7 @@
#include "config.h"
#include "macros.h"
#include "mmath.h"
-/* Do not reference types.h from this file.
+/* Do not reference mtypes.h from this file.
*/
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 170bb37e8c..3fdeb28dd3 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.108 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: context.c,v 1.109 2000/11/24 10:25:05 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -690,70 +690,6 @@ init_texture_unit( GLcontext *ctx, GLuint unit )
}
-static void
-init_fallback_arrays( GLcontext *ctx )
-{
- struct gl_client_array *cl;
- GLuint i;
-
- cl = &ctx->Fallback.Normal;
- cl->Size = 3;
- cl->Type = GL_FLOAT;
- cl->Stride = 0;
- cl->StrideB = 0;
- cl->Ptr = (void *) ctx->Current.Normal;
- cl->Enabled = 1;
-
- cl = &ctx->Fallback.Color;
- cl->Size = 4;
- cl->Type = GL_UNSIGNED_BYTE;
- cl->Stride = 0;
- cl->StrideB = 0;
- cl->Ptr = (void *) ctx->Current.Color;
- cl->Enabled = 1;
-
- cl = &ctx->Fallback.SecondaryColor;
- cl->Size = 3;
- cl->Type = GL_UNSIGNED_BYTE;
- cl->Stride = 0;
- cl->StrideB = 0;
- cl->Ptr = (void *) ctx->Current.SecondaryColor;
- cl->Enabled = 1;
-
- cl = &ctx->Fallback.FogCoord;
- cl->Size = 1;
- cl->Type = GL_FLOAT;
- cl->Stride = 0;
- cl->StrideB = 0;
- cl->Ptr = (void *) &ctx->Current.FogCoord;
- cl->Enabled = 1;
-
- cl = &ctx->Fallback.Index;
- cl->Size = 1;
- cl->Type = GL_UNSIGNED_INT;
- cl->Stride = 0;
- cl->StrideB = 0;
- cl->Ptr = (void *) &ctx->Current.Index;
- cl->Enabled = 1;
-
- for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++) {
- cl = &ctx->Fallback.TexCoord[i];
- cl->Size = 4;
- cl->Type = GL_FLOAT;
- cl->Stride = 0;
- cl->StrideB = 0;
- cl->Ptr = (void *) ctx->Current.Texcoord[i];
- cl->Enabled = 1;
- }
-
- cl = &ctx->Fallback.EdgeFlag;
- cl->Size = 1;
- cl->Type = GL_UNSIGNED_BYTE;
- cl->Stride = 0;
- cl->StrideB = 0;
- cl->Ptr = (void *) &ctx->Current.EdgeFlag;
- cl->Enabled = 1;
-}
/* Initialize a 1-D evaluator map */
@@ -908,7 +844,6 @@ init_attrib_groups( GLcontext *ctx )
ctx->Current.EdgeFlag = GL_TRUE;
ASSIGN_3V( ctx->Current.Normal, 0.0, 0.0, 1.0 );
- init_fallback_arrays( ctx );
/* Depth buffer group */
ctx->Depth.Test = GL_FALSE;
@@ -1525,6 +1460,9 @@ _mesa_initialize_context( GLcontext *ctx,
_mesa_init_dlist_table(ctx->Save, dispatchSize);
ctx->CurrentDispatch = ctx->Exec;
+ ctx->ExecPrefersFloat = GL_FALSE;
+ ctx->SavePrefersFloat = GL_FALSE;
+
#if defined(MESA_TRACE)
ctx->TraceCtx = CALLOC( sizeof(trace_context_t) );
#if 0
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 2c9a024842..250c63d813 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -1,4 +1,4 @@
-/* $Id: dd.h,v 1.42 2000/11/16 21:05:34 keithw Exp $ */
+/* $Id: dd.h,v 1.43 2000/11/24 10:25:05 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,7 +29,7 @@
#ifndef DD_INCLUDED
#define DD_INCLUDED
-/* THIS FILE ONLY INCLUDED BY types.h !!!!! */
+/* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */
struct gl_pixelstore_attrib;
@@ -872,6 +872,12 @@ struct dd_function_table {
*/
+ void (*LockArraysEXT)( GLcontext *ctx, GLint first, GLsizei count );
+ void (*UnlockArraysEXT)( GLcontext *ctx );
+ /*
+ */
+
+
/*
* State-changing functions (drawing functions are above)
*
@@ -888,9 +894,11 @@ struct dd_function_table {
GLenum dfactorRGB, GLenum sfactorA,
GLenum dfactorA );
void (*ClearDepth)(GLcontext *ctx, GLclampd d);
+ void (*ClearStencil)(GLcontext *ctx, GLint s);
void (*ColorMask)(GLcontext *ctx, GLboolean rmask, GLboolean gmask,
GLboolean bmask, GLboolean amask );
void (*CullFace)(GLcontext *ctx, GLenum mode);
+ void (*ClipPlane)(GLcontext *ctx, GLenum plane, const GLfloat *equation );
void (*FrontFace)(GLcontext *ctx, GLenum mode);
void (*DepthFunc)(GLcontext *ctx, GLenum func);
void (*DepthMask)(GLcontext *ctx, GLboolean flag);
@@ -909,10 +917,12 @@ struct dd_function_table {
void (*PolygonStipple)(GLcontext *ctx, const GLubyte *mask );
void (*Scissor)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
void (*ShadeModel)(GLcontext *ctx, GLenum mode);
- void (*ClearStencil)(GLcontext *ctx, GLint s);
void (*StencilFunc)(GLcontext *ctx, GLenum func, GLint ref, GLuint mask);
void (*StencilMask)(GLcontext *ctx, GLuint mask);
void (*StencilOp)(GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass);
+ void (*TexGen)(GLcontext *ctx, GLenum coord, GLenum pname,
+ const GLfloat *params );
+ void (*TextureMatrix)(GLcontext *ctx, GLuint unit, const GLmatrix *mat);
void (*Viewport)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
/* State-query functions
@@ -945,5 +955,114 @@ struct dd_function_table {
+
+
+
+
+typedef struct {
+
+ void (*ArrayElement)( GLint ); /* NOTE */
+ void (*Color3f)( GLfloat, GLfloat, GLfloat );
+ void (*Color3fv)( const GLfloat * );
+ void (*Color3ub)( GLubyte, GLubyte, GLubyte );
+ void (*Color3ubv)( const GLubyte * );
+ void (*Color4f)( GLfloat, GLfloat, GLfloat, GLfloat );
+ void (*Color4fv)( const GLfloat * );
+ void (*Color4ub)( GLubyte, GLubyte, GLubyte, GLubyte );
+ void (*Color4ubv)( const GLubyte * );
+ void (*EdgeFlag)( GLboolean );
+ void (*EdgeFlagv)( const GLboolean * );
+ void (*EvalCoord1f)( GLfloat ); /* NOTE */
+ void (*EvalCoord1fv)( const GLfloat * ); /* NOTE */
+ void (*EvalCoord2f)( GLfloat, GLfloat ); /* NOTE */
+ void (*EvalCoord2fv)( const GLfloat * ); /* NOTE */
+ void (*EvalPoint1)( GLint ); /* NOTE */
+ void (*EvalPoint2)( GLint, GLint ); /* NOTE */
+ void (*FogCoordfEXT)( GLfloat );
+ void (*FogCoordfvEXT)( const GLfloat * );
+ void (*Indexi)( GLint );
+ void (*Indexiv)( const GLint * );
+ void (*Materialfv)( GLenum face, GLenum pname, const GLfloat * ); /* NOTE */
+ void (*MultiTexCoord1fARB)( GLenum, GLfloat );
+ void (*MultiTexCoord1fvARB)( GLenum, const GLfloat * );
+ void (*MultiTexCoord2fARB)( GLenum, GLfloat, GLfloat );
+ void (*MultiTexCoord2fvARB)( GLenum, const GLfloat * );
+ void (*MultiTexCoord3fARB)( GLenum, GLfloat, GLfloat, GLfloat );
+ void (*MultiTexCoord3fvARB)( GLenum, const GLfloat * );
+ void (*MultiTexCoord4fARB)( GLenum, GLfloat, GLfloat, GLfloat, GLfloat );
+ void (*MultiTexCoord4fvARB)( GLenum, const GLfloat * );
+ void (*Normal3f)( GLfloat, GLfloat, GLfloat );
+ void (*Normal3fv)( const GLfloat * );
+ void (*SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat );
+ void (*SecondaryColor3fvEXT)( const GLfloat * );
+ void (*SecondaryColor3ubEXT)( GLubyte, GLubyte, GLubyte );
+ void (*SecondaryColor3ubvEXT)( const GLubyte * );
+ void (*TexCoord1f)( GLfloat );
+ void (*TexCoord1fv)( const GLfloat * );
+ void (*TexCoord2f)( GLfloat, GLfloat );
+ void (*TexCoord2fv)( const GLfloat * );
+ void (*TexCoord3f)( GLfloat, GLfloat, GLfloat );
+ void (*TexCoord3fv)( const GLfloat * );
+ void (*TexCoord4f)( GLfloat, GLfloat, GLfloat, GLfloat );
+ void (*TexCoord4fv)( const GLfloat * );
+ void (*Vertex2f)( GLfloat, GLfloat );
+ void (*Vertex2fv)( const GLfloat * );
+ void (*Vertex3f)( GLfloat, GLfloat, GLfloat );
+ void (*Vertex3fv)( const GLfloat * );
+ void (*Vertex4f)( GLfloat, GLfloat, GLfloat, GLfloat );
+ void (*Vertex4fv)( const GLfloat * );
+ void (*CallList)( GLuint ); /* NOTE */
+ void (*Begin)( GLenum );
+ void (*End)( void );
+ /* Drivers present a reduced set of the functions possible in
+ * begin/end objects. Core mesa provides translation stubs for the
+ * remaining functions to map down to these entrypoints.
+ *
+ * These are the initial values to be installed into dispatch by
+ * mesa. If the t&l driver wants to modify the dispatch table
+ * while installed, it must do so itself. It would be possible for
+ * the vertexformat to install it's own initial values for these
+ * functions, but this way there is an obvious list of what is
+ * expected of the driver.
+ *
+ * If the driver wants to hook in entrypoints other than those
+ * listed above, it must restore them to their original values in
+ * the disable() callback, below.
+ */
+
+ void (*Rectf)( GLfloat, GLfloat, GLfloat, GLfloat );
+ /*
+ */
+
+
+ void (*DrawArrays)( GLenum mode, GLint start, GLsizei count );
+ void (*DrawElements)( GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices );
+ void (*DrawRangeElements)(GLenum mode, GLuint start,
+ GLuint end, GLsizei count,
+ GLenum type, const GLvoid *indices);
+ /* These may or may not belong here. Heuristic: If an array is
+ * enabled, the installed vertex format should support that array and
+ * it's current size natively.
+ */
+
+ void (*EvalMesh1)( GLenum mode, GLint i1, GLint i2 );
+ void (*EvalMesh2)( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
+ /* If you don't support eval, fallback to the default vertex format
+ * on receiving an eval call and use the pipeline mechanism to
+ * provide partial t&l acceleration.
+ *
+ * Mesa will provide a set of helper functions to do eval within
+ * accelerated vertex formats, eventually...
+ */
+
+ GLboolean prefer_float_colors;
+ /* Should core send non-standard colors to glColor4f or glColor4ub
+ */
+
+
+} GLvertexformat;
+
+
#endif
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 01f222caf7..171ae32ae1 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1,4 +1,4 @@
-/* $Id: dlist.c,v 1.52 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: dlist.c,v 1.53 2000/11/24 10:25:05 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -30,6 +30,7 @@
#else
#include "glheader.h"
#include "accum.h"
+#include "api_loopback.h"
#include "attrib.h"
#include "bitmap.h"
#include "blend.h"
@@ -62,7 +63,6 @@
#include "points.h"
#include "polygon.h"
#include "readpix.h"
-#include "rect.h"
#include "state.h"
#include "texobj.h"
#include "teximage.h"
@@ -73,9 +73,6 @@
#include "math/m_matrix.h"
#include "math/m_xform.h"
-#include "tnl/t_vbfill.h"
-#include "tnl/t_eval.h"
-#include "tnl/t_varray.h"
#endif
@@ -216,7 +213,6 @@ typedef enum {
OPCODE_PUSH_MATRIX,
OPCODE_PUSH_NAME,
OPCODE_RASTER_POS,
- OPCODE_RECTF,
OPCODE_READ_BUFFER,
OPCODE_RESET_HISTOGRAM,
OPCODE_RESET_MIN_MAX,
@@ -605,7 +601,6 @@ void gl_init_lists( void )
InstSize[OPCODE_PUSH_MATRIX] = 1;
InstSize[OPCODE_PUSH_NAME] = 2;
InstSize[OPCODE_RASTER_POS] = 5;
- InstSize[OPCODE_RECTF] = 5;
InstSize[OPCODE_READ_BUFFER] = 2;
InstSize[OPCODE_RESET_HISTOGRAM] = 2;
InstSize[OPCODE_RESET_MIN_MAX] = 2;
@@ -2852,59 +2847,6 @@ static void save_ReadBuffer( GLenum mode )
}
-static void save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- FLUSH_TNL( ctx, FLUSH_STORED_VERTICES );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_RECTF, 4 );
- if (n) {
- n[1].f = x1;
- n[2].f = y1;
- n[3].f = x2;
- n[4].f = y2;
- }
- if (ctx->ExecuteFlag) {
- (*ctx->Exec->Rectf)( x1, y1, x2, y2 );
- }
-}
-
-static void save_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
-{
- save_Rectf(x1, y1, x2, y2);
-}
-
-static void save_Rectdv(const GLdouble *v1, const GLdouble *v2)
-{
- save_Rectf(v1[0], v1[1], v2[0], v2[1]);
-}
-
-static void save_Rectfv( const GLfloat *v1, const GLfloat *v2 )
-{
- save_Rectf(v1[0], v1[1], v2[0], v2[1]);
-}
-
-static void save_Recti(GLint x1, GLint y1, GLint x2, GLint y2)
-{
- save_Rectf(x1, y1, x2, y2);
-}
-
-static void save_Rectiv(const GLint *v1, const GLint *v2)
-{
- save_Rectf(v1[0], v1[1], v2[0], v2[1]);
-}
-
-static void save_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
-{
- save_Rectf(x1, y1, x2, y2);
-}
-
-static void save_Rectsv(const GLshort *v1, const GLshort *v2)
-{
- save_Rectf(v1[0], v1[1], v2[0], v2[1]);
-}
-
-
static void
save_ResetHistogram(GLenum target)
{
@@ -4481,10 +4423,6 @@ static void execute_list( GLcontext *ctx, GLuint list )
case OPCODE_READ_BUFFER:
(*ctx->Exec->ReadBuffer)( n[1].e );
break;
- case OPCODE_RECTF:
- (*ctx->Exec->Rectf)( n[1].f, n[2].f, n[3].f, n[4].f );
- FLUSH_TNL( ctx, FLUSH_STORED_VERTICES );
- break;
case OPCODE_RESET_HISTOGRAM:
(*ctx->Exec->ResetHistogram)( n[1].e );
break;
@@ -4824,7 +4762,9 @@ _mesa_NewList( GLuint list, GLenum mode )
/*
- * End definition of current display list.
+ * 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?
*/
void
_mesa_EndList( void )
@@ -4952,16 +4892,21 @@ _mesa_ListBase( GLuint base )
/*
* Assign all the pointers in <table> to point to Mesa's display list
* building functions.
+ *
+ * This does not include any of the tnl functions - they are
+ * initialized from _mesa_init_api_defaults and from the active vtxfmt
+ * struct.
*/
void
_mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
{
_mesa_init_no_op_table(table, tableSize);
+ _mesa_loopback_init_api_table( table, GL_FALSE );
+
/* GL 1.0 */
table->Accum = save_Accum;
table->AlphaFunc = save_AlphaFunc;
- table->Begin = _mesa_Begin;
table->Bitmap = save_Bitmap;
table->BlendFunc = save_BlendFunc;
table->CallList = save_CallList;
@@ -4973,38 +4918,6 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->ClearIndex = save_ClearIndex;
table->ClearStencil = save_ClearStencil;
table->ClipPlane = save_ClipPlane;
- table->Color3b = _mesa_Color3b;
- table->Color3bv = _mesa_Color3bv;
- table->Color3d = _mesa_Color3d;
- table->Color3dv = _mesa_Color3dv;
- table->Color3f = _mesa_Color3f;
- table->Color3fv = _mesa_Color3fv;
- table->Color3i = _mesa_Color3i;
- table->Color3iv = _mesa_Color3iv;
- table->Color3s = _mesa_Color3s;
- table->Color3sv = _mesa_Color3sv;
- table->Color3ub = _mesa_Color3ub;
- table->Color3ubv = _mesa_Color3ubv;
- table->Color3ui = _mesa_Color3ui;
- table->Color3uiv = _mesa_Color3uiv;
- table->Color3us = _mesa_Color3us;
- table->Color3usv = _mesa_Color3usv;
- table->Color4b = _mesa_Color4b;
- table->Color4bv = _mesa_Color4bv;
- table->Color4d = _mesa_Color4d;
- table->Color4dv = _mesa_Color4dv;
- table->Color4f = _mesa_Color4f;
- table->Color4fv = _mesa_Color4fv;
- table->Color4i = _mesa_Color4i;
- table->Color4iv = _mesa_Color4iv;
- table->Color4s = _mesa_Color4s;
- table->Color4sv = _mesa_Color4sv;
- table->Color4ub = _mesa_Color4ub;
- table->Color4ubv = _mesa_Color4ubv;
- table->Color4ui = _mesa_Color4ui;
- table->Color4uiv = _mesa_Color4uiv;
- table->Color4us = _mesa_Color4us;
- table->Color4usv = _mesa_Color4usv;
table->ColorMask = save_ColorMask;
table->ColorMaterial = save_ColorMaterial;
table->CopyPixels = save_CopyPixels;
@@ -5016,30 +4929,12 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->Disable = save_Disable;
table->DrawBuffer = save_DrawBuffer;
table->DrawPixels = save_DrawPixels;
- table->EdgeFlag = _mesa_EdgeFlag;
- table->EdgeFlagv = _mesa_EdgeFlagv;
table->Enable = save_Enable;
- table->End = _mesa_End;
table->EndList = _mesa_EndList;
- table->EvalCoord1d = _mesa_EvalCoord1d;
- table->EvalCoord1dv = _mesa_EvalCoord1dv;
- table->EvalCoord1f = _mesa_EvalCoord1f;
- table->EvalCoord1fv = _mesa_EvalCoord1fv;
- table->EvalCoord2d = _mesa_EvalCoord2d;
- table->EvalCoord2dv = _mesa_EvalCoord2dv;
- table->EvalCoord2f = _mesa_EvalCoord2f;
- table->EvalCoord2fv = _mesa_EvalCoord2fv;
table->EvalMesh1 = save_EvalMesh1;
table->EvalMesh2 = save_EvalMesh2;
- table->EvalPoint1 = _mesa_EvalPoint1;
- table->EvalPoint2 = _mesa_EvalPoint2;
- table->FeedbackBuffer = _mesa_FeedbackBuffer;
table->Finish = _mesa_Finish;
table->Flush = _mesa_Flush;
- table->FogCoordfEXT = _mesa_FogCoordfEXT;
- table->FogCoordfvEXT = _mesa_FogCoordfvEXT;
- table->FogCoorddEXT = _mesa_FogCoorddEXT;
- table->FogCoorddvEXT = _mesa_FogCoorddvEXT;
table->Fogf = save_Fogf;
table->Fogfv = save_Fogfv;
table->Fogi = save_Fogi;
@@ -5077,14 +4972,6 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->GetTexParameteriv = _mesa_GetTexParameteriv;
table->Hint = save_Hint;
table->IndexMask = save_IndexMask;
- table->Indexd = _mesa_Indexd;
- table->Indexdv = _mesa_Indexdv;
- table->Indexf = _mesa_Indexf;
- table->Indexfv = _mesa_Indexfv;
- table->Indexi = _mesa_Indexi;
- table->Indexiv = _mesa_Indexiv;
- table->Indexs = _mesa_Indexs;
- table->Indexsv = _mesa_Indexsv;
table->InitNames = save_InitNames;
table->IsEnabled = _mesa_IsEnabled;
table->IsList = _mesa_IsList;
@@ -5112,24 +4999,10 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->MapGrid1f = save_MapGrid1f;
table->MapGrid2d = save_MapGrid2d;
table->MapGrid2f = save_MapGrid2f;
- table->Materialf = _mesa_Materialf;
- table->Materialfv = _mesa_Materialfv;
- table->Materiali = _mesa_Materiali;
- table->Materialiv = _mesa_Materialiv;
table->MatrixMode = save_MatrixMode;
table->MultMatrixd = save_MultMatrixd;
table->MultMatrixf = save_MultMatrixf;
table->NewList = save_NewList;
- table->Normal3b = _mesa_Normal3b;
- table->Normal3bv = _mesa_Normal3bv;
- table->Normal3d = _mesa_Normal3d;
- table->Normal3dv = _mesa_Normal3dv;
- table->Normal3f = _mesa_Normal3f;
- table->Normal3fv = _mesa_Normal3fv;
- table->Normal3i = _mesa_Normal3i;
- table->Normal3iv = _mesa_Normal3iv;
- table->Normal3s = _mesa_Normal3s;
- table->Normal3sv = _mesa_Normal3sv;
table->Ortho = save_Ortho;
table->PassThrough = save_PassThrough;
table->PixelMapfv = save_PixelMapfv;
@@ -5176,74 +5049,18 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->RasterPos4sv = save_RasterPos4sv;
table->ReadBuffer = save_ReadBuffer;
table->ReadPixels = _mesa_ReadPixels;
- table->Rectd = save_Rectd;
- table->Rectdv = save_Rectdv;
- table->Rectf = save_Rectf;
- table->Rectfv = save_Rectfv;
- table->Recti = save_Recti;
- table->Rectiv = save_Rectiv;
- table->Rects = save_Rects;
- table->Rectsv = save_Rectsv;
table->RenderMode = _mesa_RenderMode;
table->Rotated = save_Rotated;
table->Rotatef = save_Rotatef;
table->Scaled = save_Scaled;
table->Scalef = save_Scalef;
table->Scissor = save_Scissor;
- table->SecondaryColor3bEXT = _mesa_SecondaryColor3bEXT;
- table->SecondaryColor3bvEXT = _mesa_SecondaryColor3bvEXT;
- table->SecondaryColor3sEXT = _mesa_SecondaryColor3sEXT;
- table->SecondaryColor3svEXT = _mesa_SecondaryColor3svEXT;
- table->SecondaryColor3iEXT = _mesa_SecondaryColor3iEXT;
- table->SecondaryColor3ivEXT = _mesa_SecondaryColor3ivEXT;
- table->SecondaryColor3fEXT = _mesa_SecondaryColor3fEXT;
- table->SecondaryColor3fvEXT = _mesa_SecondaryColor3fvEXT;
- table->SecondaryColor3dEXT = _mesa_SecondaryColor3dEXT;
- table->SecondaryColor3dvEXT = _mesa_SecondaryColor3dvEXT;
- table->SecondaryColor3ubEXT = _mesa_SecondaryColor3ubEXT;
- table->SecondaryColor3ubvEXT = _mesa_SecondaryColor3ubvEXT;
- table->SecondaryColor3usEXT = _mesa_SecondaryColor3usEXT;
- table->SecondaryColor3usvEXT = _mesa_SecondaryColor3usvEXT;
- table->SecondaryColor3uiEXT = _mesa_SecondaryColor3uiEXT;
- table->SecondaryColor3uivEXT = _mesa_SecondaryColor3uivEXT;
- table->SecondaryColorPointerEXT = _mesa_SecondaryColorPointerEXT;
+ table->FeedbackBuffer = _mesa_FeedbackBuffer;
table->SelectBuffer = _mesa_SelectBuffer;
table->ShadeModel = save_ShadeModel;
table->StencilFunc = save_StencilFunc;
table->StencilMask = save_StencilMask;
table->StencilOp = save_StencilOp;
- table->TexCoord1d = _mesa_TexCoord1d;
- table->TexCoord1dv = _mesa_TexCoord1dv;
- table->TexCoord1f = _mesa_TexCoord1f;
- table->TexCoord1fv = _mesa_TexCoord1fv;
- table->TexCoord1i = _mesa_TexCoord1i;
- table->TexCoord1iv = _mesa_TexCoord1iv;
- table->TexCoord1s = _mesa_TexCoord1s;
- table->TexCoord1sv = _mesa_TexCoord1sv;
- table->TexCoord2d = _mesa_TexCoord2d;
- table->TexCoord2dv = _mesa_TexCoord2dv;
- table->TexCoord2f = _mesa_TexCoord2f;
- table->TexCoord2fv = _mesa_TexCoord2fv;
- table->TexCoord2i = _mesa_TexCoord2i;
- table->TexCoord2iv = _mesa_TexCoord2iv;
- table->TexCoord2s = _mesa_TexCoord2s;
- table->TexCoord2sv = _mesa_TexCoord2sv;
- table->TexCoord3d = _mesa_TexCoord3d;
- table->TexCoord3dv = _mesa_TexCoord3dv;
- table->TexCoord3f = _mesa_TexCoord3f;
- table->TexCoord3fv = _mesa_TexCoord3fv;
- table->TexCoord3i = _mesa_TexCoord3i;
- table->TexCoord3iv = _mesa_TexCoord3iv;
- table->TexCoord3s = _mesa_TexCoord3s;
- table->TexCoord3sv = _mesa_TexCoord3sv;
- table->TexCoord4d = _mesa_TexCoord4d;
- table->TexCoord4dv = _mesa_TexCoord4dv;
- table->TexCoord4f = _mesa_TexCoord4f;
- table->TexCoord4fv = _mesa_TexCoord4fv;
- table->TexCoord4i = _mesa_TexCoord4i;
- table->TexCoord4iv = _mesa_TexCoord4iv;
- table->TexCoord4s = _mesa_TexCoord4s;
- table->TexCoord4sv = _mesa_TexCoord4sv;
table->TexEnvf = save_TexEnvf;
table->TexEnvfv = save_TexEnvfv;
table->TexEnvi = save_TexEnvi;
@@ -5262,35 +5079,10 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->TexParameteriv = save_TexParameteriv;
table->Translated = save_Translated;
table->Translatef = save_Translatef;
- table->Vertex2d = _mesa_Vertex2d;
- table->Vertex2dv = _mesa_Vertex2dv;
- table->Vertex2f = _mesa_Vertex2f;
- table->Vertex2fv = _mesa_Vertex2fv;
- table->Vertex2i = _mesa_Vertex2i;
- table->Vertex2iv = _mesa_Vertex2iv;
- table->Vertex2s = _mesa_Vertex2s;
- table->Vertex2sv = _mesa_Vertex2sv;
- table->Vertex3d = _mesa_Vertex3d;
- table->Vertex3dv = _mesa_Vertex3dv;
- table->Vertex3f = _mesa_Vertex3f;
- table->Vertex3fv = _mesa_Vertex3fv;
- table->Vertex3i = _mesa_Vertex3i;
- table->Vertex3iv = _mesa_Vertex3iv;
- table->Vertex3s = _mesa_Vertex3s;
- table->Vertex3sv = _mesa_Vertex3sv;
- table->Vertex4d = _mesa_Vertex4d;
- table->Vertex4dv = _mesa_Vertex4dv;
- table->Vertex4f = _mesa_Vertex4f;
- table->Vertex4fv = _mesa_Vertex4fv;
- table->Vertex4i = _mesa_Vertex4i;
- table->Vertex4iv = _mesa_Vertex4iv;
- table->Vertex4s = _mesa_Vertex4s;
- table->Vertex4sv = _mesa_Vertex4sv;
table->Viewport = save_Viewport;
/* GL 1.1 */
table->AreTexturesResident = _mesa_AreTexturesResident;
- table->ArrayElement = _mesa_ArrayElement;
table->BindTexture = save_BindTexture;
table->ColorPointer = _mesa_ColorPointer;
table->CopyTexImage1D = save_CopyTexImage1D;
@@ -5299,15 +5091,11 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->CopyTexSubImage2D = save_CopyTexSubImage2D;
table->DeleteTextures = _mesa_DeleteTextures;
table->DisableClientState = _mesa_DisableClientState;
- table->DrawArrays = _mesa_DrawArrays;
- table->DrawElements = _mesa_DrawElements;
table->EdgeFlagPointer = _mesa_EdgeFlagPointer;
table->EnableClientState = _mesa_EnableClientState;
table->GenTextures = _mesa_GenTextures;
table->GetPointerv = _mesa_GetPointerv;
table->IndexPointer = _mesa_IndexPointer;
- table->Indexub = _mesa_Indexub;
- table->Indexubv = _mesa_Indexubv;
table->InterleavedArrays = _mesa_InterleavedArrays;
table->IsTexture = _mesa_IsTexture;
table->NormalPointer = _mesa_NormalPointer;
@@ -5321,7 +5109,6 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
/* GL 1.2 */
table->CopyTexSubImage3D = save_CopyTexSubImage3D;
- table->DrawRangeElements = _mesa_DrawRangeElements;
table->TexImage3D = save_TexImage3D;
table->TexSubImage3D = save_TexSubImage3D;
@@ -5424,38 +5211,6 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
/* GL_ARB_multitexture */
table->ActiveTextureARB = save_ActiveTextureARB;
table->ClientActiveTextureARB = save_ClientActiveTextureARB;
- table->MultiTexCoord1dARB = _mesa_MultiTexCoord1dARB;
- table->MultiTexCoord1dvARB = _mesa_MultiTexCoord1dvARB;
- table->MultiTexCoord1fARB = _mesa_MultiTexCoord1fARB;
- table->MultiTexCoord1fvARB = _mesa_MultiTexCoord1fvARB;
- table->MultiTexCoord1iARB = _mesa_MultiTexCoord1iARB;
- table->MultiTexCoord1ivARB = _mesa_MultiTexCoord1ivARB;
- table->MultiTexCoord1sARB = _mesa_MultiTexCoord1sARB;
- table->MultiTexCoord1svARB = _mesa_MultiTexCoord1svARB;
- table->MultiTexCoord2dARB = _mesa_MultiTexCoord2dARB;
- table->MultiTexCoord2dvARB = _mesa_MultiTexCoord2dvARB;
- table->MultiTexCoord2fARB = _mesa_MultiTexCoord2fARB;
- table->MultiTexCoord2fvARB = _mesa_MultiTexCoord2fvARB;
- table->MultiTexCoord2iARB = _mesa_MultiTexCoord2iARB;
- table->MultiTexCoord2ivARB = _mesa_MultiTexCoord2ivARB;
- table->MultiTexCoord2sARB = _mesa_MultiTexCoord2sARB;
- table->MultiTexCoord2svARB = _mesa_MultiTexCoord2svARB;
- table->MultiTexCoord3dARB = _mesa_MultiTexCoord3dARB;
- table->MultiTexCoord3dvARB = _mesa_MultiTexCoord3dvARB;
- table->MultiTexCoord3fARB = _mesa_MultiTexCoord3fARB;
- table->MultiTexCoord3fvARB = _mesa_MultiTexCoord3fvARB;
- table->MultiTexCoord3iARB = _mesa_MultiTexCoord3iARB;
- table->MultiTexCoord3ivARB = _mesa_MultiTexCoord3ivARB;
- table->MultiTexCoord3sARB = _mesa_MultiTexCoord3sARB;
- table->MultiTexCoord3svARB = _mesa_MultiTexCoord3svARB;
- table->MultiTexCoord4dARB = _mesa_MultiTexCoord4dARB;
- table->MultiTexCoord4dvARB = _mesa_MultiTexCoord4dvARB;
- table->MultiTexCoord4fARB = _mesa_MultiTexCoord4fARB;
- table->MultiTexCoord4fvARB = _mesa_MultiTexCoord4fvARB;
- table->MultiTexCoord4iARB = _mesa_MultiTexCoord4iARB;
- table->MultiTexCoord4ivARB = _mesa_MultiTexCoord4ivARB;
- table->MultiTexCoord4sARB = _mesa_MultiTexCoord4sARB;
- table->MultiTexCoord4svARB = _mesa_MultiTexCoord4svARB;
/* GL_EXT_blend_func_separate */
table->BlendFuncSeparateEXT = save_BlendFuncSeparateEXT;
@@ -5503,6 +5258,12 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->CompressedTexSubImage2DARB = save_CompressedTexSubImage2DARB;
table->CompressedTexSubImage1DARB = save_CompressedTexSubImage1DARB;
table->GetCompressedTexImageARB = _mesa_GetCompressedTexImageARB;
+
+ /* GL_EXT_secondary_color */
+ table->SecondaryColorPointerEXT = _mesa_SecondaryColorPointerEXT;
+
+ /* GL_EXT_fog_coord */
+ table->FogCoordPointerEXT = _mesa_FogCoordPointerEXT;
}
@@ -5623,9 +5384,6 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list )
case OPCODE_RASTER_POS:
fprintf(f,"RasterPos %g %g %g %g\n", n[1].f, n[2].f,n[3].f,n[4].f);
break;
- case OPCODE_RECTF:
- fprintf( f, "Rectf %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f);
- break;
case OPCODE_ROTATE:
fprintf(f,"Rotate %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f );
break;
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 7ac2f79087..d2ad97a0da 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1,4 +1,4 @@
-/* $Id: enable.c,v 1.33 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: enable.c,v 1.34 2000/11/24 10:25:05 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -100,7 +100,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
ctx->Transform._AnyClip++;
if (ctx->ProjectionMatrix.flags & MAT_DIRTY) {
- _math_matrix_analyze( &ctx->ProjectionMatrix );
+ _math_matrix_analyse( &ctx->ProjectionMatrix );
}
/* This derived state also calculated in clip.c and
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index a1c58f8f3c..af274eabce 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1,4 +1,4 @@
-/* $Id: light.c,v 1.27 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: light.c,v 1.28 2000/11/24 10:25:05 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -122,7 +122,7 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
case GL_SPOT_DIRECTION:
/* transform direction by inverse modelview */
if (ctx->ModelView.flags & MAT_DIRTY_INVERSE) {
- _math_matrix_analyze( &ctx->ModelView );
+ _math_matrix_analyse( &ctx->ModelView );
}
TRANSFORM_NORMAL( l->EyeDirection, params, ctx->ModelView.inv );
break;
@@ -568,58 +568,48 @@ void gl_update_material( GLcontext *ctx,
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, ctx->Light.Model.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, ctx->Light.Model.Ambient );
+ ACC_SCALE_3V( ctx->Light._BaseColor[1], mat->Ambient,
+ ctx->Light.Model.Ambient );
}
/* update material diffuse values */
if (bitmask & FRONT_DIFFUSE_BIT) {
struct gl_material *mat = &ctx->Light.Material[0];
- GLfloat tmp[4];
- SUB_3V( tmp, src[0].Diffuse, mat->Diffuse );
+ COPY_4FV( mat->Diffuse, src[0].Diffuse );
foreach (light, list) {
- ACC_SCALE_3V( light->_MatDiffuse[0], light->Diffuse, tmp );
+ SCALE_3V( light->_MatDiffuse[0], light->Diffuse, mat->Diffuse );
}
- COPY_4FV( mat->Diffuse, src[0].Diffuse );
FLOAT_COLOR_TO_CHAN(ctx->Light._BaseAlpha[0], mat->Diffuse[3]);
}
if (bitmask & BACK_DIFFUSE_BIT) {
struct gl_material *mat = &ctx->Light.Material[1];
- GLfloat tmp[4];
- SUB_3V( tmp, src[1].Diffuse, mat->Diffuse );
+ COPY_4FV( mat->Diffuse, src[1].Diffuse );
foreach (light, list) {
- ACC_SCALE_3V( light->_MatDiffuse[1], light->Diffuse, tmp );
+ SCALE_3V( light->_MatDiffuse[1], light->Diffuse, mat->Diffuse );
}
- COPY_4FV( mat->Diffuse, src[1].Diffuse );
FLOAT_COLOR_TO_CHAN(ctx->Light._BaseAlpha[1], mat->Diffuse[3]);
}
/* update material specular values */
if (bitmask & FRONT_SPECULAR_BIT) {
struct gl_material *mat = &ctx->Light.Material[0];
- GLfloat tmp[4];
- SUB_3V( tmp, src[0].Specular, mat->Specular );
+ COPY_4FV( mat->Specular, src[0].Specular );
foreach (light, list) {
- ACC_SCALE_3V( light->_MatSpecular[0], light->Specular, tmp );
- light->_IsMatSpecular[0] =
- (LEN_SQUARED_3FV(light->_MatSpecular[0]) > 1e-16);
+ ACC_SCALE_3V( light->_MatSpecular[0], light->Specular, mat->Specular);
}
- COPY_4FV( mat->Specular, src[0].Specular );
}
if (bitmask & BACK_SPECULAR_BIT) {
struct gl_material *mat = &ctx->Light.Material[1];
- GLfloat tmp[4];
- SUB_3V( tmp, src[1].Specular, mat->Specular );
+ COPY_4FV( mat->Specular, src[1].Specular );
foreach (light, list) {
- ACC_SCALE_3V( light->_MatSpecular[1], light->Specular, tmp );
- light->_IsMatSpecular[1] =
- (LEN_SQUARED_3FV(light->_MatSpecular[1]) > 1e-16);
+ ACC_SCALE_3V( light->_MatSpecular[1], light->Specular, mat->Specular);
}
- COPY_4FV( mat->Specular, src[1].Specular );
}
if (bitmask & FRONT_SHININESS_BIT) {
@@ -733,49 +723,37 @@ void gl_update_color_material( GLcontext *ctx,
/* update light->_MatDiffuse = light's diffuse * material's diffuse */
if (bitmask & FRONT_DIFFUSE_BIT) {
struct gl_material *mat = &ctx->Light.Material[0];
- GLfloat tmp[4];
- SUB_3V( tmp, color, mat->Diffuse );
+ COPY_4FV( mat->Diffuse, color );
foreach (light, list) {
- ACC_SCALE_3V( light->_MatDiffuse[0], light->Diffuse, tmp );
+ SCALE_3V( light->_MatDiffuse[0], light->Diffuse, mat->Diffuse );
}
- COPY_4FV( mat->Diffuse, color );
FLOAT_COLOR_TO_CHAN(ctx->Light._BaseAlpha[0], mat->Diffuse[3]);
}
if (bitmask & BACK_DIFFUSE_BIT) {
struct gl_material *mat = &ctx->Light.Material[1];
- GLfloat tmp[4];
- SUB_3V( tmp, color, mat->Diffuse );
+ COPY_4FV( mat->Diffuse, color );
foreach (light, list) {
- ACC_SCALE_3V( light->_MatDiffuse[1], light->Diffuse, tmp );
+ SCALE_3V( light->_MatDiffuse[1], light->Diffuse, mat->Diffuse );
}
- COPY_4FV( mat->Diffuse, color );
FLOAT_COLOR_TO_CHAN(ctx->Light._BaseAlpha[1], mat->Diffuse[3]);
}
/* update light->_MatSpecular = light's specular * material's specular */
if (bitmask & FRONT_SPECULAR_BIT) {
struct gl_material *mat = &ctx->Light.Material[0];
- GLfloat tmp[4];
- SUB_3V( tmp, color, mat->Specular );
+ COPY_4FV( mat->Specular, color );
foreach (light, list) {
- ACC_SCALE_3V( light->_MatSpecular[0], light->Specular, tmp );
- light->_IsMatSpecular[0] =
- (LEN_SQUARED_3FV(light->_MatSpecular[0]) > 1e-16);
+ ACC_SCALE_3V( light->_MatSpecular[0], light->Specular, mat->Specular);
}
- COPY_4FV( mat->Specular, color );
}
if (bitmask & BACK_SPECULAR_BIT) {
struct gl_material *mat = &ctx->Light.Material[1];
- GLfloat tmp[4];
- SUB_3V( tmp, color, mat->Specular );
+ COPY_4FV( mat->Specular, color );
foreach (light, list) {
- ACC_SCALE_3V( light->_MatSpecular[1], light->Specular, tmp );
- light->_IsMatSpecular[1] =
- (LEN_SQUARED_3FV(light->_MatSpecular[1]) > 1e-16);
+ ACC_SCALE_3V( light->_MatSpecular[1], light->Specular, mat->Specular);
}
- COPY_4FV( mat->Specular, color );
}
if (0)
@@ -839,51 +817,6 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
-void
-_mesa_Materialf( GLenum face, GLenum pname, GLfloat param )
-{
- _mesa_Materialfv( face, pname, &param );
-}
-
-
-
-void
-_mesa_Materiali(GLenum face, GLenum pname, GLint param )
-{
- _mesa_Materialiv(face, pname, &param);
-}
-
-
-void
-_mesa_Materialiv(GLenum face, GLenum pname, const GLint *params )
-{
- GLfloat fparam[4];
- switch (pname) {
- case GL_AMBIENT:
- case GL_DIFFUSE:
- case GL_SPECULAR:
- case GL_EMISSION:
- case GL_AMBIENT_AND_DIFFUSE:
- fparam[0] = INT_TO_FLOAT( params[0] );
- fparam[1] = INT_TO_FLOAT( params[1] );
- fparam[2] = INT_TO_FLOAT( params[2] );
- fparam[3] = INT_TO_FLOAT( params[3] );
- break;
- case GL_SHININESS:
- fparam[0] = (GLfloat) params[0];
- break;
- case GL_COLOR_INDEXES:
- fparam[0] = (GLfloat) params[0];
- fparam[1] = (GLfloat) params[1];
- fparam[2] = (GLfloat) params[2];
- break;
- default:
- /* Error will be caught later in gl_Materialfv */
- ;
- }
- _mesa_Materialfv(face, pname, fparam);
-}
-
void
_mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params )
@@ -1190,8 +1123,6 @@ gl_update_lighting( GLcontext *ctx )
SCALE_3V( light->_MatAmbient[side], light->Ambient, mat->Ambient );
SCALE_3V( light->_MatSpecular[side], light->Specular,
mat->Specular);
- light->_IsMatSpecular[side] =
- (LEN_SQUARED_3FV(light->_MatSpecular[side]) > 1e-16);
}
}
}
diff --git a/src/mesa/main/light.h b/src/mesa/main/light.h
index 134e3782e5..604e4d5806 100644
--- a/src/mesa/main/light.h
+++ b/src/mesa/main/light.h
@@ -1,4 +1,4 @@
-/* $Id: light.h,v 1.6 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: light.h,v 1.7 2000/11/24 10:25:05 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -63,18 +63,6 @@ extern void
_mesa_LightModeliv( GLenum pname, const GLint *params );
extern void
-_mesa_Materialf( GLenum face, GLenum pname, GLfloat param );
-
-extern void
-_mesa_Materialfv( GLenum face, GLenum pname, const GLfloat *params );
-
-extern void
-_mesa_Materiali( GLenum face, GLenum pname, GLint param );
-
-extern void
-_mesa_Materialiv( GLenum face, GLenum pname, const GLint *params );
-
-extern void
_mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params );
extern void
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index d5d9e42e7f..02121e3e12 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -1,4 +1,4 @@
-/* $Id: macros.h,v 1.14 2000/11/16 21:05:35 keithw Exp $ */
+/* $Id: macros.h,v 1.15 2000/11/24 10:25:05 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -35,7 +35,7 @@
#include "glheader.h"
-/* Do not reference types.h from this file.
+/* Do not reference mtypes.h from this file.
*/
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 6573a46c02..6106a80aff 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -1,4 +1,4 @@
-/* $Id: matrix.c,v 1.27 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: matrix.c,v 1.28 2000/11/24 10:25:05 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -57,10 +57,10 @@
/**********************************************************************/
-#define GET_ACTIVE_MATRIX(ctx, mat, flags, where) \
+#define GET_ACTIVE_MATRIX(ctx, mat, flags, where) \
do { \
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, where); \
- if (MESA_VERBOSE&VERBOSE_API) fprintf(stderr, "%s\n", where); \
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, where); \
+ if (MESA_VERBOSE&VERBOSE_API) fprintf(stderr, "%s\n", where); \
switch (ctx->Transform.MatrixMode) { \
case GL_MODELVIEW: \
mat = &ctx->ModelView; \
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 03ac0c4f2a..e18bdda81b 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1,4 +1,4 @@
-/* $Id: mtypes.h,v 1.1 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: mtypes.h,v 1.2 2000/11/24 10:25:05 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -208,7 +208,6 @@ struct gl_light {
GLfloat _MatSpecular[2][3]; /* material spec * light specular */
GLfloat _dli; /* CI diffuse light intensity */
GLfloat _sli; /* CI specular light intensity */
- GLboolean _IsMatSpecular[2];
};
@@ -502,7 +501,6 @@ struct gl_light_attrib {
#define LIGHT_POSITIONAL 0x4
#define LIGHT_SPOT 0x10
#define LIGHT_LOCAL_VIEWER 0x20
-#define LIGHT_TWO_SIDE 0x40
#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
@@ -724,7 +722,6 @@ struct gl_stencil_attrib {
#define ENABLE_LIGHT 0x1000000
#define ENABLE_FOG 0x2000000
#define ENABLE_USERCLIP 0x4000000
-#define ENABLE_VIEWCLIP 0x8000000
#define ENABLE_NORMALIZE 0x10000000
#define ENABLE_RESCALE 0x20000000
#define ENABLE_POINT_ATTEN 0x40000000
@@ -976,23 +973,9 @@ struct gl_array_attrib {
GLuint LockFirst;
GLuint LockCount;
-
};
-/* These are used to make the ctx->Current values look like
- * arrays (with zero StrideB).
- */
-struct gl_fallback_arrays {
- struct gl_client_array Normal;
- struct gl_client_array Color;
- struct gl_client_array SecondaryColor;
- struct gl_client_array FogCoord;
- struct gl_client_array Index;
- struct gl_client_array TexCoord[MAX_TEXTURE_UNITS];
- struct gl_client_array EdgeFlag;
-};
-
struct gl_feedback {
@@ -1428,6 +1411,9 @@ struct __GLcontextRec {
struct _glapi_table *Save; /* Display list save funcs */
struct _glapi_table *Exec; /* Execute funcs */
struct _glapi_table *CurrentDispatch; /* == Save or Exec !! */
+
+ GLboolean ExecPrefersFloat; /* What preference for color conversion? */
+ GLboolean SavePrefersFloat;
GLvisual Visual;
GLframebuffer *DrawBuffer; /* buffer for writing */
@@ -1529,8 +1515,6 @@ struct __GLcontextRec {
struct gl_color_table PostColorMatrixColorTable;
struct gl_color_table ProxyPostColorMatrixColorTable;
- struct gl_fallback_arrays Fallback;
-
GLenum ErrorValue; /* Last error code */
GLenum RenderMode; /* either GL_RENDER, GL_SELECT, GL_FEEDBACK */
GLuint NewState; /* bitwise-or of _NEW_* flags */
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c
index 63f4e5aa49..9f6a49330d 100644
--- a/src/mesa/main/rastpos.c
+++ b/src/mesa/main/rastpos.c
@@ -1,4 +1,4 @@
-/* $Id: rastpos.c,v 1.15 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: rastpos.c,v 1.16 2000/11/24 10:25:05 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -168,7 +168,7 @@ static void gl_shade_rastpos( GLcontext *ctx,
ACC_SCALE_SCALAR_3V(contrib, n_dot_VP, light->_MatDiffuse[0]);
diffuse += n_dot_VP * light->_dli * attenuation;
- if (light->_IsMatSpecular[0]) {
+ {
if (ctx->Light.Model.LocalViewer) {
GLfloat v[3];
COPY_3V(v, vertex);
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 8db7f01304..c0c9e98e5f 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1,4 +1,4 @@
-/* $Id: state.c,v 1.47 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: state.c,v 1.48 2000/11/24 10:25:06 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -37,6 +37,7 @@
#include "glheader.h"
#include "accum.h"
#include "alpha.h"
+#include "api_loopback.h"
#include "attrib.h"
#include "bitmap.h"
#include "blend.h"
@@ -68,7 +69,6 @@
#include "polygon.h"
#include "rastpos.h"
#include "readpix.h"
-#include "rect.h"
#include "scissor.h"
#include "state.h"
#include "stencil.h"
@@ -83,10 +83,6 @@
#include "swrast/swrast.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
-#include "tnl/t_eval.h"
-#include "tnl/t_vbfill.h"
-#include "tnl/t_varray.h"
-#include "tnl/t_rect.h"
#endif
@@ -119,6 +115,9 @@ _mesa_init_no_op_table(struct _glapi_table *table, GLuint tableSize)
/*
* Initialize the given dispatch table with pointers to Mesa's
* immediate-mode commands.
+ *
+ * Pointers to begin/end object commands and a few others
+ * are provided via the vtxfmt interface elsewhere.
*/
void
_mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
@@ -126,10 +125,11 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
/* first initialize all dispatch slots to no-op */
_mesa_init_no_op_table(exec, tableSize);
+ _mesa_loopback_init_api_table( exec, GL_FALSE );
+
/* load the dispatch slots we understand */
exec->Accum = _mesa_Accum;
exec->AlphaFunc = _mesa_AlphaFunc;
- exec->Begin = _mesa_Begin;
exec->Bitmap = _mesa_Bitmap;
exec->BlendFunc = _mesa_BlendFunc;
exec->CallList = _mesa_CallList;
@@ -141,38 +141,6 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->ClearIndex = _mesa_ClearIndex;
exec->ClearStencil = _mesa_ClearStencil;
exec->ClipPlane = _mesa_ClipPlane;
- exec->Color3b = _mesa_Color3b;
- exec->Color3bv = _mesa_Color3bv;
- exec->Color3d = _mesa_Color3d;
- exec->Color3dv = _mesa_Color3dv;
- exec->Color3f = _mesa_Color3f;
- exec->Color3fv = _mesa_Color3fv;
- exec->Color3i = _mesa_Color3i;
- exec->Color3iv = _mesa_Color3iv;
- exec->Color3s = _mesa_Color3s;
- exec->Color3sv = _mesa_Color3sv;
- exec->Color3ub = _mesa_Color3ub;
- exec->Color3ubv = _mesa_Color3ubv;
- exec->Color3ui = _mesa_Color3ui;
- exec->Color3uiv = _mesa_Color3uiv;
- exec->Color3us = _mesa_Color3us;
- exec->Color3usv = _mesa_Color3usv;
- exec->Color4b = _mesa_Color4b;
- exec->Color4bv = _mesa_Color4bv;
- exec->Color4d = _mesa_Color4d;
- exec->Color4dv = _mesa_Color4dv;
- exec->Color4f = _mesa_Color4f;
- exec->Color4fv = _mesa_Color4fv;
- exec->Color4i = _mesa_Color4i;
- exec->Color4iv = _mesa_Color4iv;
- exec->Color4s = _mesa_Color4s;
- exec->Color4sv = _mesa_Color4sv;
- exec->Color4ub = _mesa_Color4ub;
- exec->Color4ubv = _mesa_Color4ubv;
- exec->Color4ui = _mesa_Color4ui;
- exec->Color4uiv = _mesa_Color4uiv;
- exec->Color4us = _mesa_Color4us;
- exec->Color4usv = _mesa_Color4usv;
exec->ColorMask = _mesa_ColorMask;
exec->ColorMaterial = _mesa_ColorMaterial;
exec->CopyPixels = _mesa_CopyPixels;
@@ -184,33 +152,12 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->Disable = _mesa_Disable;
exec->DrawBuffer = _mesa_DrawBuffer;
exec->DrawPixels = _mesa_DrawPixels;
- exec->EdgeFlag = _mesa_EdgeFlag;
- exec->EdgeFlagv = _mesa_EdgeFlagv;
exec->Enable = _mesa_Enable;
- exec->End = _mesa_End;
exec->EndList = _mesa_EndList;
- exec->EvalCoord1d = _mesa_EvalCoord1d;
- exec->EvalCoord1dv = _mesa_EvalCoord1dv;
- exec->EvalCoord1f = _mesa_EvalCoord1f;
- exec->EvalCoord1fv = _mesa_EvalCoord1fv;
- exec->EvalCoord2d = _mesa_EvalCoord2d;
- exec->EvalCoord2dv = _mesa_EvalCoord2dv;
- exec->EvalCoord2f = _mesa_EvalCoord2f;
- exec->EvalCoord2fv = _mesa_EvalCoord2fv;
- exec->EvalMesh1 = _mesa_EvalMesh1;
- exec->EvalMesh2 = _mesa_EvalMesh2;
- exec->EvalPoint1 = _mesa_EvalPoint1;
- exec->EvalPoint2 = _mesa_EvalPoint2;
exec->FeedbackBuffer = _mesa_FeedbackBuffer;
exec->Finish = _mesa_Finish;
exec->Flush = _mesa_Flush;
-
- exec->FogCoordfEXT = _mesa_FogCoordfEXT;
- exec->FogCoordfvEXT = _mesa_FogCoordfvEXT;
- exec->FogCoorddEXT = _mesa_FogCoorddEXT;
- exec->FogCoorddvEXT = _mesa_FogCoorddvEXT;
exec->FogCoordPointerEXT = _mesa_FogCoordPointerEXT;
-
exec->Fogf = _mesa_Fogf;
exec->Fogfv = _mesa_Fogfv;
exec->Fogi = _mesa_Fogi;
@@ -248,14 +195,6 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->GetTexParameteriv = _mesa_GetTexParameteriv;
exec->Hint = _mesa_Hint;
exec->IndexMask = _mesa_IndexMask;
- exec->Indexd = _mesa_Indexd;
- exec->Indexdv = _mesa_Indexdv;
- exec->Indexf = _mesa_Indexf;
- exec->Indexfv = _mesa_Indexfv;
- exec->Indexi = _mesa_Indexi;
- exec->Indexiv = _mesa_Indexiv;
- exec->Indexs = _mesa_Indexs;
- exec->Indexsv = _mesa_Indexsv;
exec->InitNames = _mesa_InitNames;
exec->IsEnabled = _mesa_IsEnabled;
exec->IsList = _mesa_IsList;
@@ -283,24 +222,10 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->MapGrid1f = _mesa_MapGrid1f;
exec->MapGrid2d = _mesa_MapGrid2d;
exec->MapGrid2f = _mesa_MapGrid2f;
- exec->Materialf = _mesa_Materialf;
- exec->Materialfv = _mesa_Materialfv;
- exec->Materiali = _mesa_Materiali;
- exec->Materialiv = _mesa_Materialiv;
exec->MatrixMode = _mesa_MatrixMode;
exec->MultMatrixd = _mesa_MultMatrixd;
exec->MultMatrixf = _mesa_MultMatrixf;
exec->NewList = _mesa_NewList;
- exec->Normal3b = _mesa_Normal3b;
- exec->Normal3bv = _mesa_Normal3bv;
- exec->Normal3d = _mesa_Normal3d;
- exec->Normal3dv = _mesa_Normal3dv;
- exec->Normal3f = _mesa_Normal3f;
- exec->Normal3fv = _mesa_Normal3fv;
- exec->Normal3i = _mesa_Normal3i;
- exec->Normal3iv = _mesa_Normal3iv;
- exec->Normal3s = _mesa_Normal3s;
- exec->Normal3sv = _mesa_Normal3sv;
exec->Ortho = _mesa_Ortho;
exec->PassThrough = _mesa_PassThrough;
exec->PixelMapfv = _mesa_PixelMapfv;
@@ -347,74 +272,18 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->RasterPos4sv = _mesa_RasterPos4sv;
exec->ReadBuffer = _mesa_ReadBuffer;
exec->ReadPixels = _mesa_ReadPixels;
- exec->Rectd = _mesa_Rectd;
- exec->Rectdv = _mesa_Rectdv;
- exec->Rectf = _mesa_Rectf;
- exec->Rectfv = _mesa_Rectfv;
- exec->Recti = _mesa_Recti;
- exec->Rectiv = _mesa_Rectiv;
- exec->Rects = _mesa_Rects;
- exec->Rectsv = _mesa_Rectsv;
exec->RenderMode = _mesa_RenderMode;
exec->Rotated = _mesa_Rotated;
exec->Rotatef = _mesa_Rotatef;
exec->Scaled = _mesa_Scaled;
exec->Scalef = _mesa_Scalef;
exec->Scissor = _mesa_Scissor;
- exec->SecondaryColor3bEXT = _mesa_SecondaryColor3bEXT;
- exec->SecondaryColor3bvEXT = _mesa_SecondaryColor3bvEXT;
- exec->SecondaryColor3sEXT = _mesa_SecondaryColor3sEXT;
- exec->SecondaryColor3svEXT = _mesa_SecondaryColor3svEXT;
- exec->SecondaryColor3iEXT = _mesa_SecondaryColor3iEXT;
- exec->SecondaryColor3ivEXT = _mesa_SecondaryColor3ivEXT;
- exec->SecondaryColor3fEXT = _mesa_SecondaryColor3fEXT;
- exec->SecondaryColor3fvEXT = _mesa_SecondaryColor3fvEXT;
- exec->SecondaryColor3dEXT = _mesa_SecondaryColor3dEXT;
- exec->SecondaryColor3dvEXT = _mesa_SecondaryColor3dvEXT;
- exec->SecondaryColor3ubEXT = _mesa_SecondaryColor3ubEXT;
- exec->SecondaryColor3ubvEXT = _mesa_SecondaryColor3ubvEXT;
- exec->SecondaryColor3usEXT = _mesa_SecondaryColor3usEXT;
- exec->SecondaryColor3usvEXT = _mesa_SecondaryColor3usvEXT;
- exec->SecondaryColor3uiEXT = _mesa_SecondaryColor3uiEXT;
- exec->SecondaryColor3uivEXT = _mesa_SecondaryColor3uivEXT;
exec->SecondaryColorPointerEXT = _mesa_SecondaryColorPointerEXT;
exec->SelectBuffer = _mesa_SelectBuffer;
exec->ShadeModel = _mesa_ShadeModel;
exec->StencilFunc = _mesa_StencilFunc;
exec->StencilMask = _mesa_StencilMask;
exec->StencilOp = _mesa_StencilOp;
- exec->TexCoord1d = _mesa_TexCoord1d;
- exec->TexCoord1dv = _mesa_TexCoord1dv;
- exec->TexCoord1f = _mesa_TexCoord1f;
- exec->TexCoord1fv = _mesa_TexCoord1fv;
- exec->TexCoord1i = _mesa_TexCoord1i;
- exec->TexCoord1iv = _mesa_TexCoord1iv;
- exec->TexCoord1s = _mesa_TexCoord1s;
- exec->TexCoord1sv = _mesa_TexCoord1sv;
- exec->TexCoord2d = _mesa_TexCoord2d;
- exec->TexCoord2dv = _mesa_TexCoord2dv;
- exec->TexCoord2f = _mesa_TexCoord2f;
- exec->TexCoord2fv = _mesa_TexCoord2fv;
- exec->TexCoord2i = _mesa_TexCoord2i;
- exec->TexCoord2iv = _mesa_TexCoord2iv;
- exec->TexCoord2s = _mesa_TexCoord2s;
- exec->TexCoord2sv = _mesa_TexCoord2sv;
- exec->TexCoord3d = _mesa_TexCoord3d;
- exec->TexCoord3dv = _mesa_TexCoord3dv;
- exec->TexCoord3f = _mesa_TexCoord3f;
- exec->TexCoord3fv = _mesa_TexCoord3fv;
- exec->TexCoord3i = _mesa_TexCoord3i;
- exec->TexCoord3iv = _mesa_TexCoord3iv;
- exec->TexCoord3s = _mesa_TexCoord3s;
- exec->TexCoord3sv = _mesa_TexCoord3sv;
- exec->TexCoord4d = _mesa_TexCoord4d;
- exec->TexCoord4dv = _mesa_TexCoord4dv;
- exec->TexCoord4f = _mesa_TexCoord4f;
- exec->TexCoord4fv = _mesa_TexCoord4fv;
- exec->TexCoord4i = _mesa_TexCoord4i;
- exec->TexCoord4iv = _mesa_TexCoord4iv;
- exec->TexCoord4s = _mesa_TexCoord4s;
- exec->TexCoord4sv = _mesa_TexCoord4sv;
exec->TexEnvf = _mesa_TexEnvf;
exec->TexEnvfv = _mesa_TexEnvfv;
exec->TexEnvi = _mesa_TexEnvi;
@@ -433,35 +302,10 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->TexParameteriv = _mesa_TexParameteriv;
exec->Translated = _mesa_Translated;
exec->Translatef = _mesa_Translatef;
- exec->Vertex2d = _mesa_Vertex2d;
- exec->Vertex2dv = _mesa_Vertex2dv;
- exec->Vertex2f = _mesa_Vertex2f;
- exec->Vertex2fv = _mesa_Vertex2fv;
- exec->Vertex2i = _mesa_Vertex2i;
- exec->Vertex2iv = _mesa_Vertex2iv;
- exec->Vertex2s = _mesa_Vertex2s;
- exec->Vertex2sv = _mesa_Vertex2sv;
- exec->Vertex3d = _mesa_Vertex3d;
- exec->Vertex3dv = _mesa_Vertex3dv;
- exec->Vertex3f = _mesa_Vertex3f;
- exec->Vertex3fv = _mesa_Vertex3fv;
- exec->Vertex3i = _mesa_Vertex3i;
- exec->Vertex3iv = _mesa_Vertex3iv;
- exec->Vertex3s = _mesa_Vertex3s;
- exec->Vertex3sv = _mesa_Vertex3sv;
- exec->Vertex4d = _mesa_Vertex4d;
- exec->Vertex4dv = _mesa_Vertex4dv;
- exec->Vertex4f = _mesa_Vertex4f;
- exec->Vertex4fv = _mesa_Vertex4fv;
- exec->Vertex4i = _mesa_Vertex4i;
- exec->Vertex4iv = _mesa_Vertex4iv;
- exec->Vertex4s = _mesa_Vertex4s;
- exec->Vertex4sv = _mesa_Vertex4sv;
exec->Viewport = _mesa_Viewport;
/* 1.1 */
exec->AreTexturesResident = _mesa_AreTexturesResident;
- exec->ArrayElement = _mesa_ArrayElement;
exec->BindTexture = _mesa_BindTexture;
exec->ColorPointer = _mesa_ColorPointer;
exec->CopyTexImage1D = _mesa_CopyTexImage1D;
@@ -470,15 +314,11 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->CopyTexSubImage2D = _mesa_CopyTexSubImage2D;
exec->DeleteTextures = _mesa_DeleteTextures;
exec->DisableClientState = _mesa_DisableClientState;
- exec->DrawArrays = _mesa_DrawArrays;
- exec->DrawElements = _mesa_DrawElements;
exec->EdgeFlagPointer = _mesa_EdgeFlagPointer;
exec->EnableClientState = _mesa_EnableClientState;
exec->GenTextures = _mesa_GenTextures;
exec->GetPointerv = _mesa_GetPointerv;
exec->IndexPointer = _mesa_IndexPointer;
- exec->Indexub = _mesa_Indexub;
- exec->Indexubv = _mesa_Indexubv;
exec->InterleavedArrays = _mesa_InterleavedArrays;
exec->IsTexture = _mesa_IsTexture;
exec->NormalPointer = _mesa_NormalPointer;
@@ -492,7 +332,6 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
/* 1.2 */
exec->CopyTexSubImage3D = _mesa_CopyTexSubImage3D;
- exec->DrawRangeElements = _mesa_DrawRangeElements;
exec->TexImage3D = _mesa_TexImage3D;
exec->TexSubImage3D = _mesa_TexSubImage3D;
@@ -634,38 +473,6 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
/* ARB 1. GL_ARB_multitexture */
exec->ActiveTextureARB = _mesa_ActiveTextureARB;
exec->ClientActiveTextureARB = _mesa_ClientActiveTextureARB;
- exec->MultiTexCoord1dARB = _mesa_MultiTexCoord1dARB;
- exec->MultiTexCoord1dvARB = _mesa_MultiTexCoord1dvARB;
- exec->MultiTexCoord1fARB = _mesa_MultiTexCoord1fARB;
- exec->MultiTexCoord1fvARB = _mesa_MultiTexCoord1fvARB;
- exec->MultiTexCoord1iARB = _mesa_MultiTexCoord1iARB;
- exec->MultiTexCoord1ivARB = _mesa_MultiTexCoord1ivARB;
- exec->MultiTexCoord1sARB = _mesa_MultiTexCoord1sARB;
- exec->MultiTexCoord1svARB = _mesa_MultiTexCoord1svARB;
- exec->MultiTexCoord2dARB = _mesa_MultiTexCoord2dARB;
- exec->MultiTexCoord2dvARB = _mesa_MultiTexCoord2dvARB;
- exec->MultiTexCoord2fARB = _mesa_MultiTexCoord2fARB;
- exec->MultiTexCoord2fvARB = _mesa_MultiTexCoord2fvARB;
- exec->MultiTexCoord2iARB = _mesa_MultiTexCoord2iARB;
- exec->MultiTexCoord2ivARB = _mesa_MultiTexCoord2ivARB;
- exec->MultiTexCoord2sARB = _mesa_MultiTexCoord2sARB;
- exec->MultiTexCoord2svARB = _mesa_MultiTexCoord2svARB;
- exec->MultiTexCoord3dARB = _mesa_MultiTexCoord3dARB;
- exec->MultiTexCoord3dvARB = _mesa_MultiTexCoord3dvARB;
- exec->MultiTexCoord3fARB = _mesa_MultiTexCoord3fARB;
- exec->MultiTexCoord3fvARB = _mesa_MultiTexCoord3fvARB;
- exec->MultiTexCoord3iARB = _mesa_MultiTexCoord3iARB;
- exec->MultiTexCoord3ivARB = _mesa_MultiTexCoord3ivARB;
- exec->MultiTexCoord3sARB = _mesa_MultiTexCoord3sARB;
- exec->MultiTexCoord3svARB = _mesa_MultiTexCoord3svARB;
- exec->MultiTexCoord4dARB = _mesa_MultiTexCoord4dARB;
- exec->MultiTexCoord4dvARB = _mesa_MultiTexCoord4dvARB;
- exec->MultiTexCoord4fARB = _mesa_MultiTexCoord4fARB;
- exec->MultiTexCoord4fvARB = _mesa_MultiTexCoord4fvARB;
- exec->MultiTexCoord4iARB = _mesa_MultiTexCoord4iARB;
- exec->MultiTexCoord4ivARB = _mesa_MultiTexCoord4ivARB;
- exec->MultiTexCoord4sARB = _mesa_MultiTexCoord4sARB;
- exec->MultiTexCoord4svARB = _mesa_MultiTexCoord4svARB;
/* ARB 3. GL_ARB_transpose_matrix */
exec->LoadTransposeMatrixdARB = _mesa_LoadTransposeMatrixdARB;
@@ -733,7 +540,7 @@ calculate_model_project_matrix( GLcontext *ctx )
&ctx->ProjectionMatrix,
&ctx->ModelView );
- _math_matrix_analyze( &ctx->_ModelProjectMatrix );
+ _math_matrix_analyse( &ctx->_ModelProjectMatrix );
}
}
@@ -824,8 +631,8 @@ update_drawbuffer( GLcontext *ctx )
static void
update_projection( GLcontext *ctx )
{
- _math_matrix_analyze( &ctx->ProjectionMatrix );
-
+ _math_matrix_analyse( &ctx->ProjectionMatrix );
+
/* Recompute clip plane positions in clipspace. This is also done
* in _mesa_ClipPlane().
*/
@@ -921,7 +728,7 @@ void gl_update_state( GLcontext *ctx )
gl_print_state("", new_state);
if (new_state & _NEW_MODELVIEW)
- _math_matrix_analyze( &ctx->ModelView );
+ _math_matrix_analyse( &ctx->ModelView );
if (new_state & _NEW_PROJECTION)
update_projection( ctx );
@@ -930,7 +737,7 @@ void gl_update_state( GLcontext *ctx )
_mesa_update_texture_matrices( ctx );
if (new_state & _NEW_COLOR_MATRIX)
- _math_matrix_analyze( &ctx->ColorMatrix );
+ _math_matrix_analyse( &ctx->ColorMatrix );
/* References ColorMatrix.type (derived above).
*/
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index e481bedf24..eee2a3a6ae 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -1,4 +1,4 @@
-/* $Id: texstate.c,v 1.24 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: texstate.c,v 1.25 2000/11/24 10:25:06 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -1116,7 +1116,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
else if (pname==GL_EYE_PLANE) {
/* Transform plane equation by the inverse modelview matrix */
if (ctx->ModelView.flags & MAT_DIRTY_INVERSE) {
- _math_matrix_analyze( &ctx->ModelView );
+ _math_matrix_analyse( &ctx->ModelView );
}
gl_transform_vector( texUnit->EyePlaneS, params,
ctx->ModelView.inv );
@@ -1164,7 +1164,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
else if (pname==GL_EYE_PLANE) {
/* Transform plane equation by the inverse modelview matrix */
if (ctx->ModelView.flags & MAT_DIRTY_INVERSE) {
- _math_matrix_analyze( &ctx->ModelView );
+ _math_matrix_analyse( &ctx->ModelView );
}
gl_transform_vector( texUnit->EyePlaneT, params,
ctx->ModelView.inv );
@@ -1208,7 +1208,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
else if (pname==GL_EYE_PLANE) {
/* Transform plane equation by the inverse modelview matrix */
if (ctx->ModelView.flags & MAT_DIRTY_INVERSE) {
- _math_matrix_analyze( &ctx->ModelView );
+ _math_matrix_analyse( &ctx->ModelView );
}
gl_transform_vector( texUnit->EyePlaneR, params,
ctx->ModelView.inv );
@@ -1244,7 +1244,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
else if (pname==GL_EYE_PLANE) {
/* Transform plane equation by the inverse modelview matrix */
if (ctx->ModelView.flags & MAT_DIRTY_INVERSE) {
- _math_matrix_analyze( &ctx->ModelView );
+ _math_matrix_analyse( &ctx->ModelView );
}
gl_transform_vector( texUnit->EyePlaneQ, params,
ctx->ModelView.inv );
@@ -1258,6 +1258,9 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
gl_error( ctx, GL_INVALID_ENUM, "glTexGenfv(coord)" );
return;
}
+
+ if (ctx->Driver.TexGen)
+ ctx->Driver.TexGen( ctx, coord, pname, params );
ctx->NewState |= _NEW_TEXTURE;
}
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index d03f0b79ff..7b9b1052c2 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1,4 +1,4 @@
-/* $Id: varray.c,v 1.32 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: varray.c,v 1.33 2000/11/24 10:25:06 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -692,3 +692,48 @@ _mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer)
+/* Transform the array components now, upto the setup call. When
+ * actual draw commands arrive, the data will be merged prior to
+ * calling render_vb.
+ */
+void
+_mesa_LockArraysEXT(GLint first, GLsizei count)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "glLockArraysEXT" );
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ fprintf(stderr, "glLockArrays %d %d\n", first, count);
+
+ if (first == 0 && count > 0 && count <= ctx->Const.MaxArrayLockSize) {
+ ctx->Array.LockFirst = first;
+ ctx->Array.LockCount = count;
+ }
+ else {
+ ctx->Array.LockFirst = 0;
+ ctx->Array.LockCount = 0;
+ }
+
+ ctx->NewState |= _NEW_ARRAY;
+
+ if (ctx->Driver.LockArraysEXT)
+ ctx->Driver.LockArraysEXT( ctx, first, count );
+}
+
+
+void
+_mesa_UnlockArraysEXT( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "glUnlockArraysEXT" );
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ fprintf(stderr, "glUnlockArrays\n");
+
+ ctx->Array.LockFirst = 0;
+ ctx->Array.LockCount = 0;
+ ctx->NewState |= _NEW_ARRAY;
+
+ if (ctx->Driver.UnlockArraysEXT)
+ ctx->Driver.UnlockArraysEXT( ctx );
+}
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index 3e30cf5bf1..c365d914a5 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -1,4 +1,4 @@
-/* $Id: varray.h,v 1.10 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: varray.h,v 1.11 2000/11/24 10:25:06 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -36,6 +36,12 @@ extern void
_mesa_VertexPointer(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr);
+extern void
+_mesa_UnlockArraysEXT( void );
+
+extern void
+_mesa_LockArraysEXT(GLint first, GLsizei count);
+
extern void
_mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr);