From 360bec8a6f3a525ce236bdac3da3f298db90cb49 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 5 Mar 2003 14:04:18 +0000 Subject: [PATCH] Start subsetting core mesa --- src/mesa/main/colortab.h | 8 ++++++-- src/mesa/main/config.h | 6 +++++- src/mesa/main/convolve.h | 9 ++++++++- src/mesa/main/debug.h | 6 +++++- src/mesa/main/dlist.h | 9 +++++++-- src/mesa/main/enums.h | 7 ++++++- src/mesa/main/extensions.h | 11 +++++++++-- src/mesa/main/light.h | 14 +++++++++++--- src/mesa/main/state.c | 7 +++++-- src/mesa/main/texcompress.h | 11 +++++++++-- 10 files changed, 71 insertions(+), 17 deletions(-) diff --git a/src/mesa/main/colortab.h b/src/mesa/main/colortab.h index 813b4e28771..428cc303d2a 100644 --- a/src/mesa/main/colortab.h +++ b/src/mesa/main/colortab.h @@ -1,4 +1,4 @@ -/* $Id: colortab.h,v 1.9 2001/03/12 00:48:37 gareth Exp $ */ +/* $Id: colortab.h,v 1.9.8.1 2003/03/05 14:04:18 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -31,7 +31,7 @@ #include "mtypes.h" - +#if _HAVE_FULL_GL extern void _mesa_init_colortable( struct gl_color_table *p ); @@ -83,5 +83,9 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ); extern void _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ); +#else +#define _mesa_init_colortable( p ) ((void)0) +#define _mesa_free_colortable_data( p ) ((void)0) +#endif #endif diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 985176f7498..6aa0ac29c2b 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -1,4 +1,4 @@ -/* $Id: config.h,v 1.42 2002/10/16 17:57:51 brianp Exp $ */ +/* $Id: config.h,v 1.42.4.1 2003/03/05 14:04:19 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -201,7 +201,11 @@ /* * Enable/disable features (blocks of code) by setting FEATURE_xyz to 0 or 1. */ +#if _HAVE_FULL_GL #define FEATURE_NV_vertex_program 1 +#else +#define FEATURE_NV_vertex_program 0 +#endif #endif /* CONFIG_H */ diff --git a/src/mesa/main/convolve.h b/src/mesa/main/convolve.h index 72a5d6f6327..077cf8d1442 100644 --- a/src/mesa/main/convolve.h +++ b/src/mesa/main/convolve.h @@ -1,4 +1,4 @@ -/* $Id: convolve.h,v 1.4 2001/02/06 17:22:16 brianp Exp $ */ +/* $Id: convolve.h,v 1.4.8.1 2003/03/05 14:04:19 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -32,6 +32,7 @@ #include "mtypes.h" +#if _HAVE_FULL_GL extern void _mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); @@ -104,5 +105,11 @@ extern void _mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, GLsizei *width, GLsizei *height); +#else +#define _mesa_adjust_image_for_convolution(c, d, w, h) ((void)0) +#define _mesa_convolve_1d_image(c,w,s,d) ((void)0) +#define _mesa_convolve_2d_image(c,w,h,s,d) ((void)0) +#define _mesa_convolve_sep_image(c,w,h,s,d) ((void)0) +#endif #endif diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h index 2565f018c53..05ffa6f83c5 100644 --- a/src/mesa/main/debug.h +++ b/src/mesa/main/debug.h @@ -1,4 +1,4 @@ -/* $Id: debug.h,v 1.3 2001/03/12 00:48:37 gareth Exp $ */ +/* $Id: debug.h,v 1.3.8.1 2003/03/05 14:04:19 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -27,8 +27,12 @@ #ifndef _DEBUG_H #define _DEBUG_H +#if _HAVE_FULL_GL void _mesa_print_tri_caps( const char *name, GLuint flags ); void _mesa_print_enable_flags( const char *msg, GLuint flags ); void _mesa_print_state( const char *msg, GLuint state ); +#else +#define _mesa_print_state( m, s ) ((void)0) +#endif #endif diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h index 6671620d470..8809a04bc57 100644 --- a/src/mesa/main/dlist.h +++ b/src/mesa/main/dlist.h @@ -1,4 +1,4 @@ -/* $Id: dlist.h,v 1.17 2001/12/14 02:50:01 brianp Exp $ */ +/* $Id: dlist.h,v 1.17.6.1 2003/03/05 14:04:19 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -63,6 +63,7 @@ do { \ } while (0) +#if _HAVE_FULL_GL extern void _mesa_init_lists( void ); extern void _mesa_destroy_list( GLcontext *ctx, GLuint list ); @@ -103,7 +104,11 @@ extern void _mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, extern void _mesa_save_EvalMesh1( GLenum mode, GLint i1, GLint i2 ); extern void _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); extern void _mesa_save_CallList( GLuint list ); - +#else +#define _mesa_init_lists() ((void)0) +#define _mesa_destroy_list(c,l) ((void)0) +#define _mesa_init_dlist_table(t,ts) ((void)0) +#endif #endif diff --git a/src/mesa/main/enums.h b/src/mesa/main/enums.h index 6a859172530..456080fcbe9 100644 --- a/src/mesa/main/enums.h +++ b/src/mesa/main/enums.h @@ -1,4 +1,4 @@ -/* $Id: enums.h,v 1.3 2001/03/12 00:48:37 gareth Exp $ */ +/* $Id: enums.h,v 1.3.8.1 2003/03/05 14:04:19 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -28,7 +28,12 @@ #ifndef _ENUMS_H_ #define _ENUMS_H_ +#if _HAVE_FULL_GL extern const char *_mesa_lookup_enum_by_nr( int nr ); extern int _mesa_lookup_enum_by_name( const char *symbol ); +#else +#define _mesa_lookup_enum_by_name( s ) 0 +#define _mesa_lookup_enum_by_nr( n ) "unknown" +#endif #endif diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h index d940be2e434..01285bb88ea 100644 --- a/src/mesa/main/extensions.h +++ b/src/mesa/main/extensions.h @@ -1,4 +1,4 @@ -/* $Id: extensions.h,v 1.15 2002/06/29 20:03:13 brianp Exp $ */ +/* $Id: extensions.h,v 1.15.6.1 2003/03/05 14:04:19 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -30,7 +30,7 @@ #include "mtypes.h" - +#if _HAVE_FULL_GL extern void _mesa_enable_sw_extensions(GLcontext *ctx); extern void _mesa_enable_imaging_extensions(GLcontext *ctx); @@ -53,5 +53,12 @@ extern void _mesa_extensions_dtr( GLcontext *ctx ); extern void _mesa_extensions_ctr( GLcontext *ctx ); extern const char *_mesa_extensions_get_string( GLcontext *ctx ); +#else +#define _mesa_extensions_dtr( ctx ) ((void)0) +#define _mesa_extensions_ctr( ctx ) ((void)0) +#define _mesa_extensions_get_string( ctx ) "GL_EXT_texture_object" +#define _mesa_enable_imaging_extensions( c ) ((void)0) +#define _mesa_enable_extension( c, n ) ((void)0) +#endif #endif diff --git a/src/mesa/main/light.h b/src/mesa/main/light.h index 63c40f87975..13136ed7f41 100644 --- a/src/mesa/main/light.h +++ b/src/mesa/main/light.h @@ -1,4 +1,4 @@ -/* $Id: light.h,v 1.15 2002/10/25 21:06:30 brianp Exp $ */ +/* $Id: light.h,v 1.15.4.1 2003/03/05 14:04:20 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -31,10 +31,10 @@ #include "mtypes.h" - extern void _mesa_ShadeModel( GLenum mode ); +#if _HAVE_FULL_GL extern void _mesa_ColorMaterial( GLenum face, GLenum mode ); @@ -92,7 +92,6 @@ do { \ } while (0) - extern GLuint _mesa_material_bitmask( GLcontext *ctx, GLenum face, GLenum pname, GLuint legal, @@ -119,5 +118,14 @@ extern void _mesa_copy_material_pairs( struct gl_material dst[2], extern void _mesa_update_color_material( GLcontext *ctx, const GLfloat rgba[4] ); +#else +#define _mesa_update_lighting( c ) ((void)0) +#define _mesa_update_color_material( c, r ) ((void)0) +#define _mesa_validate_all_lighting_tables( c ) ((void)0) +#define _mesa_invalidate_spot_exp_table( l ) ((void)0) +#define _mesa_material_bitmask( c, f, p, l, s ) 0 +#define _mesa_compute_light_positions( c ) ((void)0) +#define GET_SHINE_TAB_ENTRY( table, dp, result ) ((result)=0) +#endif #endif diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index f8789779939..32847fa9a67 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -1,4 +1,4 @@ -/* $Id: state.c,v 1.97.4.2 2003/03/04 17:10:39 keithw Exp $ */ +/* $Id: state.c,v 1.97.4.3 2003/03/05 14:04:20 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -69,6 +69,7 @@ #if FEATURE_NV_vertex_program #include "vpstate.h" #endif +#include "debug.h" #include "math/m_matrix.h" #include "math/m_xform.h" @@ -111,7 +112,9 @@ _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); +#if _HAVE_FULL_GL _mesa_loopback_init_api_table( exec, GL_TRUE ); +#endif /* load the dispatch slots we understand */ exec->AlphaFunc = _mesa_AlphaFunc; @@ -506,7 +509,7 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize) #endif /* 233. GL_NV_vertex_program */ -#if _HAVE_FULL_GL && FEATURE_NV_vertex_program +#if FEATURE_NV_vertex_program exec->BindProgramNV = _mesa_BindProgramNV; exec->DeleteProgramsNV = _mesa_DeleteProgramsNV; exec->ExecuteProgramNV = _mesa_ExecuteProgramNV; diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index c1377a819be..8f7c35eaca1 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -1,4 +1,4 @@ -/* $Id: texcompress.h,v 1.2 2002/10/18 17:41:45 brianp Exp $ */ +/* $Id: texcompress.h,v 1.2.4.1 2003/03/05 14:04:21 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -29,7 +29,7 @@ #include "mtypes.h" - +#if _HAVE_FULL_GL extern GLuint _mesa_get_compressed_formats( GLcontext *ctx, GLint *formats ); @@ -54,5 +54,12 @@ _mesa_compress_teximage( GLcontext *ctx, GLsizei width, GLsizei height, GLint srcRowStride, const struct gl_texture_format *dstFormat, GLubyte *dest, GLint dstRowStride ); +#else +#define _mesa_get_compressed_formats( c, f ) 0 +#define _mesa_compressed_texture_size( c, w, h, d, f ) 0 +#define _mesa_compressed_row_stride( f, w) 0 +#define _mesa_compressed_image_address(c, r, i, f, w, i2 ) 0 +#define _mesa_compress_teximage( c, w, h, sF, s, sRS, dF, d, drs ) ((void)0) +#endif #endif /* TEXCOMPRESS_H */