diff options
author | Brian Paul <[email protected]> | 2013-05-01 19:15:33 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-05-02 09:03:16 -0600 |
commit | 200e09e393c05706d830667cbf626d1d51c000c4 (patch) | |
tree | efb4d61df5192e3665a51d597a33d95654afd961 /src/mesa/vbo | |
parent | 0f365b2d77e35391283998dbf1311a4aae3cc760 (diff) |
mesa: remove GLvertexformat::EvalMesh1(), EvalMesh2()
See previous commit comments.
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r-- | src/mesa/vbo/vbo_exec_api.c | 107 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_exec_array.c | 107 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_noop.c | 13 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_save_api.c | 26 |
4 files changed, 107 insertions, 146 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 93fa8d7bb19..88cce984f8d 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -654,111 +654,6 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j ) } -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. */ @@ -904,8 +799,6 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) 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: */ diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index f1abe0490c4..d2cadf941bc 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -650,6 +650,111 @@ vbo_exec_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) } +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). */ @@ -1400,6 +1505,8 @@ vbo_initialize_exec_dispatch(const struct gl_context *ctx, 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)) { diff --git a/src/mesa/vbo/vbo_noop.c b/src/mesa/vbo/vbo_noop.c index cff26bf14b3..8ba4959bd1f 100644 --- a/src/mesa/vbo/vbo_noop.c +++ b/src/mesa/vbo/vbo_noop.c @@ -347,17 +347,6 @@ _mesa_noop_PrimitiveRestartNV(void) } -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 @@ -388,8 +377,6 @@ _mesa_noop_vtxfmt_init(GLvertexformat * vfmt) 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; diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 4d9a6366a58..b8dd90c67f1 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -994,30 +994,6 @@ _save_End(void) 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) { GET_CURRENT_CONTEXT(ctx); @@ -1359,8 +1335,6 @@ _save_vtxfmt_init(struct gl_context *ctx) 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. |