diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/dd.h | 16 | ||||
-rw-r--r-- | src/mesa/main/dlist.c | 2 | ||||
-rw-r--r-- | src/mesa/main/eval.c | 10 | ||||
-rw-r--r-- | src/mesa/main/eval.h | 3 | ||||
-rw-r--r-- | src/mesa/main/vtxfmt.c | 2 | ||||
-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 |
9 files changed, 110 insertions, 176 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index e3240a26f8f..4c76fa49616 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -1019,22 +1019,6 @@ typedef struct { 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; diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index ae2a5529606..c37b15ee64b 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -9592,8 +9592,6 @@ save_vtxfmt_init(GLvertexformat * vfmt) 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; diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index 4b6d63c697b..349331f0002 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -824,8 +824,7 @@ _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, 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); @@ -833,13 +832,6 @@ _mesa_install_eval_vtxfmt(struct _glapi_table *disp, 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); - } } diff --git a/src/mesa/main/eval.h b/src/mesa/main/eval.h index 9b6358b0cac..33240f00d33 100644 --- a/src/mesa/main/eval.h +++ b/src/mesa/main/eval.h @@ -65,8 +65,7 @@ extern GLfloat *_mesa_copy_map_points2d(GLenum target, 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 ); diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 3a0e7d357ee..d7bf98ec8ec 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -63,7 +63,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, } 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) { 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. |