See previous commit comments.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
void (GLAPIENTRYP VertexAttribP4uiv)( GLuint index, GLenum type,
GLboolean normalized,
const GLuint *value);
-
- /*@}*/
-
- /**
- * \name Eval
- *
- * If you don't support eval, fallback to the default vertex format
- * on receiving an eval call and use the pipeline mechanism to
- * provide partial T&L acceleration.
- *
- * Mesa will provide a set of helper functions to do eval within
- * accelerated vertex formats, eventually...
- */
- /*@{*/
- void (GLAPIENTRYP EvalMesh1)( GLenum mode, GLint i1, GLint i2 );
- void (GLAPIENTRYP EvalMesh2)( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
/*@}*/
} GLvertexformat;
vfmt->EvalCoord2fv = save_EvalCoord2fv;
vfmt->EvalPoint1 = save_EvalPoint1;
vfmt->EvalPoint2 = save_EvalPoint2;
- vfmt->EvalMesh1 = save_EvalMesh1;
- vfmt->EvalMesh2 = save_EvalMesh2;
vfmt->FogCoordfEXT = save_FogCoordfEXT;
vfmt->FogCoordfvEXT = save_FogCoordfvEXT;
void
_mesa_install_eval_vtxfmt(struct _glapi_table *disp,
- const GLvertexformat *vfmt,
- bool beginend)
+ const GLvertexformat *vfmt)
{
SET_EvalCoord1f(disp, vfmt->EvalCoord1f);
SET_EvalCoord1fv(disp, vfmt->EvalCoord1fv);
SET_EvalCoord2fv(disp, vfmt->EvalCoord2fv);
SET_EvalPoint1(disp, vfmt->EvalPoint1);
SET_EvalPoint2(disp, vfmt->EvalPoint2);
-
- /* glEvalMesh1 and glEvalMesh2 are not allowed between glBegin and glEnd.
- */
- if (!beginend) {
- SET_EvalMesh1(disp, vfmt->EvalMesh1);
- SET_EvalMesh2(disp, vfmt->EvalMesh2);
- }
}
extern void
_mesa_install_eval_vtxfmt(struct _glapi_table *disp,
- const GLvertexformat *vfmt,
- bool beginend);
+ const GLvertexformat *vfmt);
extern void _mesa_init_eval( struct gl_context *ctx );
extern void _mesa_free_eval_data( struct gl_context *ctx );
}
if (ctx->API == API_OPENGL_COMPAT) {
- _mesa_install_eval_vtxfmt(tab, vfmt, beginend);
+ _mesa_install_eval_vtxfmt(tab, vfmt);
}
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
}
-static void GLAPIENTRY
-vbo_exec_EvalMesh1(GLenum mode, GLint i1, GLint i2)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint i;
- GLfloat u, du;
- GLenum prim;
-
- switch (mode) {
- case GL_POINT:
- prim = GL_POINTS;
- break;
- case GL_LINE:
- prim = GL_LINE_STRIP;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh1(mode)" );
- return;
- }
-
- /* No effect if vertex maps disabled.
- */
- if (!ctx->Eval.Map1Vertex4 &&
- !ctx->Eval.Map1Vertex3)
- return;
-
- du = ctx->Eval.MapGrid1du;
- u = ctx->Eval.MapGrid1u1 + i1 * du;
-
- CALL_Begin(GET_DISPATCH(), (prim));
- for (i=i1;i<=i2;i++,u+=du) {
- CALL_EvalCoord1f(GET_DISPATCH(), (u));
- }
- CALL_End(GET_DISPATCH(), ());
-}
-
-
-static void GLAPIENTRY
-vbo_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLfloat u, du, v, dv, v1, u1;
- GLint i, j;
-
- switch (mode) {
- case GL_POINT:
- case GL_LINE:
- case GL_FILL:
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh2(mode)" );
- return;
- }
-
- /* No effect if vertex maps disabled.
- */
- if (!ctx->Eval.Map2Vertex4 &&
- !ctx->Eval.Map2Vertex3)
- return;
-
- du = ctx->Eval.MapGrid2du;
- dv = ctx->Eval.MapGrid2dv;
- v1 = ctx->Eval.MapGrid2v1 + j1 * dv;
- u1 = ctx->Eval.MapGrid2u1 + i1 * du;
-
- switch (mode) {
- case GL_POINT:
- CALL_Begin(GET_DISPATCH(), (GL_POINTS));
- for (v=v1,j=j1;j<=j2;j++,v+=dv) {
- for (u=u1,i=i1;i<=i2;i++,u+=du) {
- CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
- }
- }
- CALL_End(GET_DISPATCH(), ());
- break;
- case GL_LINE:
- for (v=v1,j=j1;j<=j2;j++,v+=dv) {
- CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP));
- for (u=u1,i=i1;i<=i2;i++,u+=du) {
- CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
- }
- CALL_End(GET_DISPATCH(), ());
- }
- for (u=u1,i=i1;i<=i2;i++,u+=du) {
- CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP));
- for (v=v1,j=j1;j<=j2;j++,v+=dv) {
- CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
- }
- CALL_End(GET_DISPATCH(), ());
- }
- break;
- case GL_FILL:
- for (v=v1,j=j1;j<j2;j++,v+=dv) {
- CALL_Begin(GET_DISPATCH(), (GL_TRIANGLE_STRIP));
- for (u=u1,i=i1;i<=i2;i++,u+=du) {
- CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
- CALL_EvalCoord2f(GET_DISPATCH(), (u, v+dv));
- }
- CALL_End(GET_DISPATCH(), ());
- }
- break;
- }
-}
-
-
/**
* Called via glBegin.
*/
vfmt->EvalCoord2fv = vbo_exec_EvalCoord2fv;
vfmt->EvalPoint1 = vbo_exec_EvalPoint1;
vfmt->EvalPoint2 = vbo_exec_EvalPoint2;
- vfmt->EvalMesh1 = vbo_exec_EvalMesh1;
- vfmt->EvalMesh2 = vbo_exec_EvalMesh2;
/* from attrib_tmp.h:
*/
}
+static void GLAPIENTRY
+vbo_exec_EvalMesh1(GLenum mode, GLint i1, GLint i2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+ GLfloat u, du;
+ GLenum prim;
+
+ switch (mode) {
+ case GL_POINT:
+ prim = GL_POINTS;
+ break;
+ case GL_LINE:
+ prim = GL_LINE_STRIP;
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh1(mode)" );
+ return;
+ }
+
+ /* No effect if vertex maps disabled.
+ */
+ if (!ctx->Eval.Map1Vertex4 &&
+ !ctx->Eval.Map1Vertex3)
+ return;
+
+ du = ctx->Eval.MapGrid1du;
+ u = ctx->Eval.MapGrid1u1 + i1 * du;
+
+ CALL_Begin(GET_DISPATCH(), (prim));
+ for (i=i1;i<=i2;i++,u+=du) {
+ CALL_EvalCoord1f(GET_DISPATCH(), (u));
+ }
+ CALL_End(GET_DISPATCH(), ());
+}
+
+
+static void GLAPIENTRY
+vbo_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLfloat u, du, v, dv, v1, u1;
+ GLint i, j;
+
+ switch (mode) {
+ case GL_POINT:
+ case GL_LINE:
+ case GL_FILL:
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh2(mode)" );
+ return;
+ }
+
+ /* No effect if vertex maps disabled.
+ */
+ if (!ctx->Eval.Map2Vertex4 &&
+ !ctx->Eval.Map2Vertex3)
+ return;
+
+ du = ctx->Eval.MapGrid2du;
+ dv = ctx->Eval.MapGrid2dv;
+ v1 = ctx->Eval.MapGrid2v1 + j1 * dv;
+ u1 = ctx->Eval.MapGrid2u1 + i1 * du;
+
+ switch (mode) {
+ case GL_POINT:
+ CALL_Begin(GET_DISPATCH(), (GL_POINTS));
+ for (v=v1,j=j1;j<=j2;j++,v+=dv) {
+ for (u=u1,i=i1;i<=i2;i++,u+=du) {
+ CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
+ }
+ }
+ CALL_End(GET_DISPATCH(), ());
+ break;
+ case GL_LINE:
+ for (v=v1,j=j1;j<=j2;j++,v+=dv) {
+ CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP));
+ for (u=u1,i=i1;i<=i2;i++,u+=du) {
+ CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
+ }
+ CALL_End(GET_DISPATCH(), ());
+ }
+ for (u=u1,i=i1;i<=i2;i++,u+=du) {
+ CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP));
+ for (v=v1,j=j1;j<=j2;j++,v+=dv) {
+ CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
+ }
+ CALL_End(GET_DISPATCH(), ());
+ }
+ break;
+ case GL_FILL:
+ for (v=v1,j=j1;j<j2;j++,v+=dv) {
+ CALL_Begin(GET_DISPATCH(), (GL_TRIANGLE_STRIP));
+ for (u=u1,i=i1;i<=i2;i++,u+=du) {
+ CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
+ CALL_EvalCoord2f(GET_DISPATCH(), (u, v+dv));
+ }
+ CALL_End(GET_DISPATCH(), ());
+ }
+ break;
+ }
+}
+
+
/**
* Called from glDrawArrays when in immediate mode (not display list mode).
*/
if (ctx->API == API_OPENGL_COMPAT) {
SET_Rectf(exec, vbo_exec_Rectf);
+ SET_EvalMesh1(exec, vbo_exec_EvalMesh1);
+ SET_EvalMesh2(exec, vbo_exec_EvalMesh2);
}
if (_mesa_is_desktop_gl(ctx)) {
}
-static void GLAPIENTRY
-_mesa_noop_EvalMesh1(GLenum mode, GLint i1, GLint i2)
-{
-}
-
-static void GLAPIENTRY
-_mesa_noop_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
-{
-}
-
-
/**
* Build a vertexformat of functions that are no-ops.
* These are used in out-of-memory situations when we have no VBO
vfmt->EvalCoord2fv = _mesa_noop_EvalCoord2fv;
vfmt->EvalPoint1 = _mesa_noop_EvalPoint1;
vfmt->EvalPoint2 = _mesa_noop_EvalPoint2;
- vfmt->EvalMesh1 = _mesa_noop_EvalMesh1;
- vfmt->EvalMesh2 = _mesa_noop_EvalMesh2;
vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT;
vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT;
}
-static void GLAPIENTRY
-_save_EvalMesh1(GLenum mode, GLint i1, GLint i2)
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode;
- (void) i1;
- (void) i2;
- _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glEvalMesh1");
-}
-
-
-static void GLAPIENTRY
-_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode;
- (void) i1;
- (void) i2;
- (void) j1;
- (void) j2;
- _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glEvalMesh2");
-}
-
-
static void GLAPIENTRY
_save_Begin(GLenum mode)
{
vfmt->EvalCoord2fv = _save_EvalCoord2fv;
vfmt->EvalPoint1 = _save_EvalPoint1;
vfmt->EvalPoint2 = _save_EvalPoint2;
- vfmt->EvalMesh1 = _save_EvalMesh1;
- vfmt->EvalMesh2 = _save_EvalMesh2;
/* These calls all generate GL_INVALID_OPERATION since this vtxfmt is
* only used when we're inside a glBegin/End pair.