[Mesa-dev] [PATCH v2 06/12] state_tracker: compute version and then call _mesa_initialize_exec_table

Jordan Justen jordan.l.justen at intel.com
Sun Nov 18 23:49:32 PST 2012


This change forces the context version to be computed before
initilizing the exec dispatch tables.

In order to compute the version, we must first initialize
the context extensions constants.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/mesa/state_tracker/st_context.c |    6 ++++++
 src/mesa/state_tracker/st_manager.c |    2 --
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 69bd503..210c1b7 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -27,9 +27,11 @@
 
 #include "main/imports.h"
 #include "main/accum.h"
+#include "main/api_exec.h"
 #include "main/context.h"
 #include "main/samplerobj.h"
 #include "main/shaderobj.h"
+#include "main/version.h"
 #include "program/prog_cache.h"
 #include "vbo/vbo.h"
 #include "glapi/glapi.h"
@@ -201,6 +203,10 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
    st_init_limits(st);
    st_init_extensions(st);
 
+   _mesa_compute_version(ctx);
+
+   _mesa_initialize_exec_table(ctx);
+
    return st;
 }
 
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 88b886d..505a34f 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -646,8 +646,6 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
 
    /* need to perform version check */
    if (attribs->major > 1 || attribs->minor > 0) {
-      _mesa_compute_version(st->ctx);
-
       /* Is the actual version less than the requested version?  Mesa can't
        * yet enforce the added restrictions of a forward-looking context, so
        * fail that too.
-- 
1.7.10.4



More information about the mesa-dev mailing list