summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/config.h9
-rw-r--r--src/mesa/main/context.c13
-rw-r--r--src/mesa/main/dlist.c8
-rw-r--r--src/mesa/main/enable.c12
-rw-r--r--src/mesa/main/extensions.c4
-rw-r--r--src/mesa/main/get.c14
-rw-r--r--src/mesa/main/state.c6
-rw-r--r--src/mesa/tnl/t_pipeline.c4
8 files changed, 54 insertions, 16 deletions
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index c3738174d4e..985176f7498 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -1,4 +1,4 @@
-/* $Id: config.h,v 1.41 2002/10/05 03:01:28 brianp Exp $ */
+/* $Id: config.h,v 1.42 2002/10/16 17:57:51 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -197,4 +197,11 @@
#define ACOMP 3
+
+/*
+ * Enable/disable features (blocks of code) by setting FEATURE_xyz to 0 or 1.
+ */
+#define FEATURE_NV_vertex_program 1
+
+
#endif /* CONFIG_H */
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index b5872471c8d..4bd36bbcded 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.184 2002/10/14 17:08:17 brianp Exp $ */
+/* $Id: context.c,v 1.185 2002/10/16 17:57:51 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -633,7 +633,9 @@ alloc_shared_state( void )
ss->DisplayList = _mesa_NewHashTable();
ss->TexObjects = _mesa_NewHashTable();
+#if FEATURE_NV_vertex_program
ss->VertexPrograms = _mesa_NewHashTable();
+#endif
/* Default Texture objects */
outOfMemory = GL_FALSE;
@@ -665,7 +667,10 @@ alloc_shared_state( void )
outOfMemory = GL_TRUE;
}
- if (!ss->DisplayList || !ss->TexObjects || !ss->VertexPrograms
+ if (!ss->DisplayList || !ss->TexObjects
+#if FEATURE_NV_vertex_program
+ || !ss->VertexPrograms
+#endif
|| outOfMemory) {
/* Ran out of memory at some point. Free everything and return NULL */
if (ss->DisplayList)
@@ -720,6 +725,7 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
}
_mesa_DeleteHashTable(ss->TexObjects);
+#if FEATURE_NV_vertex_program
/* Free vertex programs */
while (1) {
GLuint prog = _mesa_HashFirstEntry(ss->VertexPrograms);
@@ -731,6 +737,7 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
}
}
_mesa_DeleteHashTable(ss->VertexPrograms);
+#endif
FREE(ss);
}
@@ -1928,11 +1935,13 @@ _mesa_free_context_data( GLcontext *ctx )
_math_matrix_dtr( &ctx->_ModelProjectMatrix );
+#if FEATURE_NV_vertex_program
if (ctx->VertexProgram.Current) {
ctx->VertexProgram.Current->RefCount--;
if (ctx->VertexProgram.Current->RefCount <= 0)
_mesa_delete_program(ctx, ctx->VertexProgram.CurrentID);
}
+#endif
/* Shared context state (display lists, textures, etc) */
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 1b9028712ae..f8c21d97db8 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1,4 +1,4 @@
-/* $Id: dlist.c,v 1.97 2002/10/07 15:03:14 brianp Exp $ */
+/* $Id: dlist.c,v 1.98 2002/10/16 17:57:51 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -65,7 +65,9 @@
#include "texstate.h"
#include "mtypes.h"
#include "varray.h"
+#if FEATURE_NV_vertex_program
#include "vpstate.h"
+#endif
#include "math/m_matrix.h"
#include "math/m_xform.h"
@@ -3988,6 +3990,7 @@ save_PixelTexGenParameterfvSGIS(GLenum target, const GLfloat *value)
/*
* GL_NV_vertex_program
*/
+#if FEATURE_NV_vertex_program
static void
save_BindProgramNV(GLenum target, GLuint id)
{
@@ -4117,6 +4120,7 @@ save_TrackMatrixNV(GLenum target, GLuint address,
(*ctx->Exec->TrackMatrixNV)(target, address, matrix, transform);
}
}
+#endif /* FEATURE_NV_vertex_program */
/* GL_EXT_stencil_two_side */
@@ -6181,6 +6185,7 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->WindowPos4sMESA = save_WindowPos4sMESA;
table->WindowPos4svMESA = save_WindowPos4svMESA;
+#if FEATURE_NV_vertex_program
/* 233. GL_NV_vertex_program */
/* The following commands DO NOT go into display lists:
* AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
@@ -6211,6 +6216,7 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->ProgramParameters4fvNV = save_ProgramParameters4fvNV;
table->TrackMatrixNV = save_TrackMatrixNV;
table->VertexAttribPointerNV = _mesa_VertexAttribPointerNV;
+#endif
/* 262. GL_NV_point_sprite */
table->PointParameteriNV = save_PointParameteriNV;
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 0f51078c618..8f45a6706a7 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1,4 +1,4 @@
-/* $Id: enable.c,v 1.69 2002/09/06 02:56:08 brianp Exp $ */
+/* $Id: enable.c,v 1.70 2002/10/16 17:57:51 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -91,7 +91,7 @@ client_state( GLcontext *ctx, GLenum cap, GLboolean state )
flag = _NEW_ARRAY_COLOR1;
break;
- /* GL_NV_vertex_program */
+#if FEATURE_NV_vertex_program
case GL_VERTEX_ATTRIB_ARRAY0_NV:
case GL_VERTEX_ATTRIB_ARRAY1_NV:
case GL_VERTEX_ATTRIB_ARRAY2_NV:
@@ -115,6 +115,8 @@ client_state( GLcontext *ctx, GLenum cap, GLboolean state )
flag = _NEW_ARRAY_ATTRIB(n);
}
break;
+#endif /* FEATURE_NV_vertex_program */
+
default:
_mesa_error( ctx, GL_INVALID_ENUM,
"glEnable/DisableClientState(0x%x)", cap);
@@ -804,7 +806,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
ctx->Point.PointSprite = state;
break;
- /* GL_NV_vertex_program */
+#if FEATURE_NV_vertex_program
case GL_VERTEX_PROGRAM_NV:
CHECK_EXTENSION(NV_vertex_program, cap);
if (ctx->VertexProgram.Enabled == state)
@@ -872,6 +874,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
ctx->Eval.Map2Attrib[map] = state;
}
break;
+#endif /* FEATURE_NV_vertex_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
@@ -1190,7 +1193,7 @@ _mesa_IsEnabled( GLenum cap )
case GL_POINT_SPRITE_NV:
return ctx->Point.PointSprite;
- /* GL_NV_vertex_program */
+#if FEATURE_NV_vertex_program
case GL_VERTEX_PROGRAM_NV:
CHECK_EXTENSION(NV_vertex_program);
return ctx->VertexProgram.Enabled;
@@ -1263,6 +1266,7 @@ _mesa_IsEnabled( GLenum cap )
const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV);
return ctx->Eval.Map2Attrib[map];
}
+#endif /* FEATURE_NV_vertex_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 0129c8601af..ec4422daa21 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -1,4 +1,4 @@
-/* $Id: extensions.c,v 1.81 2002/09/27 02:45:37 brianp Exp $ */
+/* $Id: extensions.c,v 1.82 2002/10/16 17:57:52 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -190,8 +190,10 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
"GL_NV_point_sprite",
"GL_NV_texture_rectangle",
"GL_NV_texgen_reflection",
+#if FEATURE_NV_vertex_program
"GL_NV_vertex_program",
"GL_NV_vertex_program1_1",
+#endif
"GL_SGI_color_matrix",
"GL_SGI_color_table",
"GL_SGIS_generate_mipmap",
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 90cc7b6a8cd..196740cb2e1 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1,4 +1,4 @@
-/* $Id: get.c,v 1.95 2002/10/15 15:23:16 brianp Exp $ */
+/* $Id: get.c,v 1.96 2002/10/16 17:57:52 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1348,7 +1348,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = ENUM_TO_BOOL(ctx->Hint.GenerateMipmap);
break;
- /* GL_NV_vertex_program */
+#if FEATURE_NV_vertex_program
case GL_VERTEX_PROGRAM_NV:
CHECK_EXTENSION_B(NV_vertex_program, pname);
*params = ctx->VertexProgram.Enabled;
@@ -1451,6 +1451,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = ctx->Eval.Map2Attrib[n];
}
break;
+#endif /* FEATURE_NV_vertex_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
@@ -2712,7 +2713,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Hint.GenerateMipmap;
break;
- /* GL_NV_vertex_program */
+#if FEATURE_NV_vertex_program
case GL_VERTEX_PROGRAM_NV:
CHECK_EXTENSION_D(NV_vertex_program, pname);
*params = (GLdouble) ctx->VertexProgram.Enabled;
@@ -2815,6 +2816,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Eval.Map2Attrib[n];
}
break;
+#endif /* FEATURE_NV_vertex_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
@@ -4052,7 +4054,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = (GLfloat) ctx->Hint.GenerateMipmap;
break;
- /* GL_NV_vertex_program */
+#if FEATURE_NV_vertex_program
case GL_VERTEX_PROGRAM_NV:
CHECK_EXTENSION_F(NV_vertex_program, pname);
*params = (GLfloat) ctx->VertexProgram.Enabled;
@@ -4169,6 +4171,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
CHECK_EXTENSION_F(NV_texture_rectangle, pname);
*params = (GLfloat) ctx->Const.MaxTextureRectSize;
break;
+#endif /* FEATURE_NV_vertex_program */
/* GL_EXT_stencil_two_side */
case GL_STENCIL_TEST_TWO_SIDE_EXT:
@@ -5431,7 +5434,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Hint.GenerateMipmap;
break;
- /* GL_NV_vertex_program */
+#if FEATURE_NV_vertex_program
case GL_VERTEX_PROGRAM_NV:
CHECK_EXTENSION_I(NV_vertex_program, pname);
*params = (GLint) ctx->VertexProgram.Enabled;
@@ -5548,6 +5551,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
CHECK_EXTENSION_I(NV_texture_rectangle, pname);
*params = (GLint) ctx->Const.MaxTextureRectSize;
break;
+#endif /* FEATURE_NV_vertex_program */
/* GL_EXT_stencil_two_side */
case GL_STENCIL_TEST_TWO_SIDE_EXT:
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index a7414241a01..4df1afbc831 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1,4 +1,4 @@
-/* $Id: state.c,v 1.94 2002/10/08 23:59:33 brianp Exp $ */
+/* $Id: state.c,v 1.95 2002/10/16 17:57:52 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -69,7 +69,9 @@
#include "texstate.h"
#include "mtypes.h"
#include "varray.h"
+#if FEATURE_NV_vertex_program
#include "vpstate.h"
+#endif
#include "math/m_matrix.h"
#include "math/m_xform.h"
@@ -462,6 +464,7 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->WindowPos4svMESA = _mesa_WindowPos4svMESA;
/* 233. GL_NV_vertex_program */
+#if FEATURE_NV_vertex_program
exec->BindProgramNV = _mesa_BindProgramNV;
exec->DeleteProgramsNV = _mesa_DeleteProgramsNV;
exec->ExecuteProgramNV = _mesa_ExecuteProgramNV;
@@ -487,6 +490,7 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->ProgramParameters4fvNV = _mesa_ProgramParameters4fvNV;
exec->TrackMatrixNV = _mesa_TrackMatrixNV;
exec->VertexAttribPointerNV = _mesa_VertexAttribPointerNV;
+#endif
/* 262. GL_NV_point_sprite */
exec->PointParameteriNV = _mesa_PointParameteriNV;
diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c
index d17719f6d7f..d6121d70b6f 100644
--- a/src/mesa/tnl/t_pipeline.c
+++ b/src/mesa/tnl/t_pipeline.c
@@ -1,4 +1,4 @@
-/* $Id: t_pipeline.c,v 1.22 2002/01/22 14:35:17 brianp Exp $ */
+/* $Id: t_pipeline.c,v 1.23 2002/10/16 17:57:52 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -203,7 +203,9 @@ const struct gl_pipeline_stage *_tnl_default_pipeline[] = {
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
&_tnl_point_attenuation_stage,
+#if FEATURE_NV_vertex_program
&_tnl_vertex_program_stage,
+#endif
&_tnl_render_stage,
0
};