From 17f2649e269b9d98abd6a66f687ffa29904bf4a0 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 8 Sep 2009 10:25:22 +0800 Subject: mesa/main: Make FEATURE_evaluators follow feature conventions. As shown in mfeatures.h, this allows users of eval.h to work without knowing if the feature is available. It is renamed to FEATURE_eval along the way. --- src/mesa/main/eval.h | 49 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) (limited to 'src/mesa/main/eval.h') diff --git a/src/mesa/main/eval.h b/src/mesa/main/eval.h index b3ff0a96f8..49fd37a057 100644 --- a/src/mesa/main/eval.h +++ b/src/mesa/main/eval.h @@ -37,13 +37,22 @@ #define EVAL_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL -extern void _mesa_init_eval( GLcontext *ctx ); -extern void _mesa_free_eval_data( GLcontext *ctx ); +#if FEATURE_eval +#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->EvalCoord1f = impl ## EvalCoord1f; \ + (vfmt)->EvalCoord1fv = impl ## EvalCoord1fv; \ + (vfmt)->EvalCoord2f = impl ## EvalCoord2f; \ + (vfmt)->EvalCoord2fv = impl ## EvalCoord2fv; \ + (vfmt)->EvalPoint1 = impl ## EvalPoint1; \ + (vfmt)->EvalPoint2 = impl ## EvalPoint2; \ + (vfmt)->EvalMesh1 = impl ## EvalMesh1; \ + (vfmt)->EvalMesh2 = impl ## EvalMesh2; \ + } while (0) extern GLuint _mesa_evaluator_components( GLenum target ); @@ -115,14 +124,32 @@ _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ); extern void GLAPIENTRY _mesa_GetMapiv( GLenum target, GLenum query, GLint *v ); -#else +extern void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); + +extern void +_mesa_init_eval_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_eval */ + +#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) do { } while (0) -/** No-op */ -#define _mesa_init_eval( c ) ((void)0) +static INLINE void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} -/** No-op */ -#define _mesa_free_eval_data( c ) ((void)0) +static INLINE void +_mesa_init_eval_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_eval */ + +extern void _mesa_init_eval( GLcontext *ctx ); +extern void _mesa_free_eval_data( GLcontext *ctx ); -#endif -#endif +#endif /* EVAL_H */ -- cgit v1.2.3