-/* $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
#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 */
-/* $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
ss->DisplayList = _mesa_NewHashTable();
ss->TexObjects = _mesa_NewHashTable();
+#if FEATURE_NV_vertex_program
ss->VertexPrograms = _mesa_NewHashTable();
+#endif
/* Default Texture objects */
outOfMemory = GL_FALSE;
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)
}
_mesa_DeleteHashTable(ss->TexObjects);
+#if FEATURE_NV_vertex_program
/* Free vertex programs */
while (1) {
GLuint prog = _mesa_HashFirstEntry(ss->VertexPrograms);
}
}
_mesa_DeleteHashTable(ss->VertexPrograms);
+#endif
FREE(ss);
}
_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);
-/* $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
#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"
/*
* GL_NV_vertex_program
*/
+#if FEATURE_NV_vertex_program
static void
save_BindProgramNV(GLenum target, GLuint id)
{
(*ctx->Exec->TrackMatrixNV)(target, address, matrix, transform);
}
}
+#endif /* FEATURE_NV_vertex_program */
/* GL_EXT_stencil_two_side */
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,
table->ProgramParameters4fvNV = save_ProgramParameters4fvNV;
table->TrackMatrixNV = save_TrackMatrixNV;
table->VertexAttribPointerNV = _mesa_VertexAttribPointerNV;
+#endif
/* 262. GL_NV_point_sprite */
table->PointParameteriNV = save_PointParameteriNV;
-/* $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
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:
flag = _NEW_ARRAY_ATTRIB(n);
}
break;
+#endif /* FEATURE_NV_vertex_program */
+
default:
_mesa_error( ctx, GL_INVALID_ENUM,
"glEnable/DisableClientState(0x%x)", cap);
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)
ctx->Eval.Map2Attrib[map] = state;
}
break;
+#endif /* FEATURE_NV_vertex_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
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;
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:
-/* $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
"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",
-/* $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
*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;
*params = ctx->Eval.Map2Attrib[n];
}
break;
+#endif /* FEATURE_NV_vertex_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
*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;
*params = (GLdouble) ctx->Eval.Map2Attrib[n];
}
break;
+#endif /* FEATURE_NV_vertex_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
*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;
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:
*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;
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:
-/* $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
#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"
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;
exec->ProgramParameters4fvNV = _mesa_ProgramParameters4fvNV;
exec->TrackMatrixNV = _mesa_TrackMatrixNV;
exec->VertexAttribPointerNV = _mesa_VertexAttribPointerNV;
+#endif
/* 262. GL_NV_point_sprite */
exec->PointParameteriNV = _mesa_PointParameteriNV;
-/* $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
&_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
};