1 /**
2  * \file eval.h
3  * Eval operations.
4  *
5  * \if subset
6  * (No-op)
7  *
8  * \endif
9  */
10 
11 /*
12  * Mesa 3-D graphics library
13  * Version:  3.5
14  *
15  * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining a
18  * copy of this software and associated documentation files (the "Software"),
19  * to deal in the Software without restriction, including without limitation
20  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
21  * and/or sell copies of the Software, and to permit persons to whom the
22  * Software is furnished to do so, subject to the following conditions:
23  *
24  * The above copyright notice and this permission notice shall be included
25  * in all copies or substantial portions of the Software.
26  *
27  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
28  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
30  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
31  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
32  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33  */
34 
35 
36 #ifndef EVAL_H
37 #define EVAL_H
38 
39 
40 #include "main/mfeatures.h"
41 #include "main/mtypes.h"
42 
43 
44 #if FEATURE_evaluators
45 
46 #define _MESA_INIT_EVAL_VTXFMT(vfmt, impl)         \
47    do {                                            \
48       (vfmt)->EvalCoord1f  = impl ## EvalCoord1f;  \
49       (vfmt)->EvalCoord1fv = impl ## EvalCoord1fv; \
50       (vfmt)->EvalCoord2f  = impl ## EvalCoord2f;  \
51       (vfmt)->EvalCoord2fv = impl ## EvalCoord2fv; \
52       (vfmt)->EvalPoint1   = impl ## EvalPoint1;   \
53       (vfmt)->EvalPoint2   = impl ## EvalPoint2;   \
54       (vfmt)->EvalMesh1    = impl ## EvalMesh1;    \
55       (vfmt)->EvalMesh2    = impl ## EvalMesh2;    \
56    } while (0)
57 
58 extern GLuint _mesa_evaluator_components( GLenum target );
59 
60 
61 extern GLfloat *_mesa_copy_map_points1f( GLenum target,
62                                       GLint ustride, GLint uorder,
63                                       const GLfloat *points );
64 
65 extern GLfloat *_mesa_copy_map_points1d( GLenum target,
66                                       GLint ustride, GLint uorder,
67                                       const GLdouble *points );
68 
69 extern GLfloat *_mesa_copy_map_points2f( GLenum target,
70                                       GLint ustride, GLint uorder,
71                                       GLint vstride, GLint vorder,
72                                       const GLfloat *points );
73 
74 extern GLfloat *_mesa_copy_map_points2d(GLenum target,
75                                      GLint ustride, GLint uorder,
76                                      GLint vstride, GLint vorder,
77                                      const GLdouble *points );
78 
79 extern void
80 _mesa_install_eval_vtxfmt(struct _glapi_table *disp,
81                           const GLvertexformat *vfmt);
82 
83 extern void
84 _mesa_init_eval_dispatch(struct _glapi_table *disp);
85 
86 #else /* FEATURE_evaluators */
87 
88 #define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) do { } while (0)
89 
90 static inline void
_mesa_install_eval_vtxfmt(struct _glapi_table * disp,const GLvertexformat * vfmt)91 _mesa_install_eval_vtxfmt(struct _glapi_table *disp,
92                           const GLvertexformat *vfmt)
93 {
94 }
95 
96 static inline void
_mesa_init_eval_dispatch(struct _glapi_table * disp)97 _mesa_init_eval_dispatch(struct _glapi_table *disp)
98 {
99 }
100 
101 #endif /* FEATURE_evaluators */
102 
103 extern void _mesa_init_eval( struct gl_context *ctx );
104 extern void _mesa_free_eval_data( struct gl_context *ctx );
105 
106 
107 #endif /* EVAL_H */
108