OSDN Git Service

mesa: assert if driver did not compute the version
authorJordan Justen <jordan.l.justen@intel.com>
Fri, 16 Nov 2012 21:40:59 +0000 (13:40 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Sun, 16 Dec 2012 23:30:28 +0000 (15:30 -0800)
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 <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mapi/glapi/gen/gl_genexec.py
src/mesa/main/context.c
src/mesa/main/vtxfmt.c

index 7952ace..da9ae71 100644 (file)
@@ -127,6 +127,7 @@ _mesa_initialize_exec_table(struct gl_context *ctx)
    exec = ctx->Exec;
    assert(exec != NULL);
 
+   assert(ctx->Version > 0);
 """
 
 
index ce4188f..fc2db12 100644 (file)
@@ -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);
 
index 5f42b33..6d687de 100644 (file)
@@ -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);
    }