From 1358f3a905448f6fb546aba951e317f743a83c76 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Fri, 16 Nov 2012 13:40:59 -0800 Subject: mesa: assert if driver did not compute the version Make sure drivers initialize the version before: * _mesa_initialize_exec_table is called * _mesa_initialize_exec_table_vbo is called * A context is made current Signed-off-by: Jordan Justen Reviewed-by: Kenneth Graunke --- src/mapi/glapi/gen/gl_genexec.py | 1 + src/mesa/main/context.c | 2 +- src/mesa/main/vtxfmt.c | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py index 7952ace280f..da9ae716a54 100644 --- a/src/mapi/glapi/gen/gl_genexec.py +++ b/src/mapi/glapi/gen/gl_genexec.py @@ -127,6 +127,7 @@ _mesa_initialize_exec_table(struct gl_context *ctx) exec = ctx->Exec; assert(exec != NULL); + assert(ctx->Version > 0); """ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index ce4188fe2a3..fc2db127161 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1461,7 +1461,7 @@ _mesa_make_current( struct gl_context *newCtx, } if (newCtx->FirstTimeCurrent) { - _mesa_compute_version(newCtx); + assert(newCtx->Version > 0); newCtx->Extensions.String = _mesa_make_extension_string(newCtx); diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 5f42b338d0e..6d687de606b 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -47,6 +47,8 @@ static void install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, const GLvertexformat *vfmt) { + assert(ctx->Version > 0); + if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) { SET_Color4f(tab, vfmt->Color4f); } -- cgit v1.2.3