drivers: compute version and then initialize exec table
authorJordan Justen <jordan.l.justen@intel.com>
Fri, 16 Nov 2012 18:30:19 +0000 (10:30 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Sun, 16 Dec 2012 23:30:27 +0000 (15:30 -0800)
This change forces the context version to be computed before
initilizing the exec dispatch tables.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 files changed:
src/mesa/drivers/dri/i915/i830_context.c
src/mesa/drivers/dri/i915/i915_context.c
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/nouveau/nouveau_context.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/radeon/radeon_context.c
src/mesa/drivers/dri/swrast/swrast.c
src/mesa/drivers/osmesa/osmesa.c
src/mesa/drivers/windows/gdi/wmesa.c
src/mesa/drivers/x11/xm_api.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_manager.c

index 3da0745577627b788d7fbbe901349c2d6bf0ad20..e822660c635aa535ba48c227745aee9575d533e0 100644 (file)
  **************************************************************************/
 
 #include "i830_context.h"
+#include "main/api_exec.h"
 #include "main/imports.h"
+#include "main/version.h"
+#include "main/vtxfmt.h"
 #include "tnl/tnl.h"
 #include "tnl/t_vertex.h"
 #include "tnl/t_context.h"
@@ -111,5 +114,10 @@ i830CreateContext(const struct gl_config * mesaVis,
    _tnl_allow_vertex_fog(ctx, 1);
    _tnl_allow_pixel_fog(ctx, 0);
 
+   _mesa_compute_version(ctx);
+
+   _mesa_initialize_exec_table(ctx);
+   _mesa_initialize_vbo_vtxfmt(ctx);
+
    return true;
 }
index d47e20f86088a5b7b3cd3a911b5d77bc51146d82..a6b8e4627e5976e30662f54d30c356ffbcb6a528 100644 (file)
  **************************************************************************/
 
 #include "i915_context.h"
+#include "main/api_exec.h"
 #include "main/imports.h"
 #include "main/macros.h"
+#include "main/version.h"
+#include "main/vtxfmt.h"
 #include "intel_tris.h"
 #include "tnl/t_context.h"
 #include "tnl/t_pipeline.h"
@@ -295,5 +298,10 @@ i915CreateContext(int api,
    _tnl_allow_vertex_fog(ctx, 0);
    _tnl_allow_pixel_fog(ctx, 1);
 
+   _mesa_compute_version(ctx);
+
+   _mesa_initialize_exec_table(ctx);
+   _mesa_initialize_vbo_vtxfmt(ctx);
+
    return true;
 }
index 5665a3a85179ac38ef739ed6be0e3095823381f1..df0f8d604917f5354a31ea94a304998abd994887 100644 (file)
   */
 
 
+#include "main/api_exec.h"
 #include "main/imports.h"
 #include "main/macros.h"
 #include "main/simple_list.h"
+#include "main/version.h"
+#include "main/vtxfmt.h"
 
 #include "vbo/vbo_context.h"
 
@@ -386,6 +389,11 @@ brwCreateContext(int api,
    if (INTEL_DEBUG & DEBUG_SHADER_TIME)
       brw_init_shader_time(brw);
 
+   _mesa_compute_version(ctx);
+
+   _mesa_initialize_exec_table(ctx);
+   _mesa_initialize_vbo_vtxfmt(ctx);
+
    return true;
 }
 
index 7e7dcc49944aa147e2ecdcd90b8cfe06384d8759..8811562dfa80ea6baef297a7931e73d1148be0d3 100644 (file)
 #include "nouveau_fbo.h"
 #include "nv_object.xml.h"
 
+#include "main/api_exec.h"
 #include "main/dd.h"
 #include "main/framebuffer.h"
 #include "main/fbobject.h"
 #include "main/light.h"
 #include "main/state.h"
 #include "main/version.h"
+#include "main/vtxfmt.h"
 #include "drivers/common/meta.h"
 #include "drivers/common/driverfuncs.h"
 #include "swrast/swrast.h"
@@ -103,6 +105,10 @@ nouveau_context_create(gl_api api,
           return GL_FALSE;
        }
 
+       /* Exec table initialization requires the version to be computed */
+       _mesa_initialize_exec_table(ctx);
+       _mesa_initialize_vbo_vtxfmt(ctx);
+
        if (nouveau_bo_new(context_dev(ctx), NOUVEAU_BO_VRAM, 0, 4096,
                           NULL, &nctx->fence)) {
                nouveau_context_destroy(dri_ctx);
index 54cf33e5c664596b4dd52231b278b13f53591826..cf35079b2454921794b95ca19be1df5a0d9a6c42 100644 (file)
@@ -35,12 +35,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <stdbool.h>
 #include "main/glheader.h"
 #include "main/api_arrayelt.h"
+#include "main/api_exec.h"
 #include "main/context.h"
 #include "main/simple_list.h"
 #include "main/imports.h"
 #include "main/extensions.h"
 #include "main/mfeatures.h"
 #include "main/version.h"
+#include "main/vtxfmt.h"
 
 #include "swrast/swrast.h"
 #include "swrast_setup/swrast_setup.h"
@@ -459,6 +461,10 @@ GLboolean r200CreateContext( gl_api api,
 
    _mesa_compute_version(ctx);
 
+   /* Exec table initialization requires the version to be computed */
+   _mesa_initialize_exec_table(ctx);
+   _mesa_initialize_vbo_vtxfmt(ctx);
+
    *error = __DRI_CTX_ERROR_SUCCESS;
    return GL_TRUE;
 }
index d29e1461d86cc62120ad3c6597d1d16baa1fcb6f..26490ea4e04c6fd576d4f2d73a49d91fb765ce9f 100644 (file)
@@ -37,12 +37,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <stdbool.h>
 #include "main/glheader.h"
 #include "main/api_arrayelt.h"
+#include "main/api_exec.h"
 #include "main/context.h"
 #include "main/simple_list.h"
 #include "main/imports.h"
 #include "main/extensions.h"
 #include "main/mfeatures.h"
 #include "main/version.h"
+#include "main/vtxfmt.h"
 
 #include "swrast/swrast.h"
 #include "swrast_setup/swrast_setup.h"
@@ -412,6 +414,10 @@ r100CreateContext( gl_api api,
 
    _mesa_compute_version(ctx);
 
+   /* Exec table initialization requires the version to be computed */
+   _mesa_initialize_exec_table(ctx);
+   _mesa_initialize_vbo_vtxfmt(ctx);
+
    *error = __DRI_CTX_ERROR_SUCCESS;
    return GL_TRUE;
 }
index 2474ed88fb0c9ed2acf7a624bfaca5062e2d6120..33420f78d6a71c027025b68d2e7b7e08fb4bfb51 100644 (file)
  * The back-buffer is allocated by the driver and is private.
  */
 
+#include "main/api_exec.h"
 #include "main/context.h"
 #include "main/extensions.h"
 #include "main/formats.h"
 #include "main/framebuffer.h"
 #include "main/imports.h"
 #include "main/renderbuffer.h"
+#include "main/version.h"
+#include "main/vtxfmt.h"
 #include "swrast/swrast.h"
 #include "swrast/s_renderbuffer.h"
 #include "swrast_setup/swrast_setup.h"
@@ -786,6 +789,11 @@ dri_create_context(gl_api api,
         break;
     }
 
+    _mesa_compute_version(mesaCtx);
+
+    _mesa_initialize_exec_table(mesaCtx);
+    _mesa_initialize_vbo_vtxfmt(mesaCtx);
+
     *error = __DRI_CTX_ERROR_SUCCESS;
     return GL_TRUE;
 
index c206d64350908d9daa5f3e5b47a4ad3c26393c27..95756d5d574b3cef0503882dba64374e42f1e12d 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "main/glheader.h"
 #include "GL/osmesa.h"
+#include "main/api_exec.h"
 #include "main/context.h"
 #include "main/extensions.h"
 #include "main/formats.h"
@@ -43,6 +44,8 @@
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/renderbuffer.h"
+#include "main/version.h"
+#include "main/vtxfmt.h"
 #include "swrast/swrast.h"
 #include "swrast_setup/swrast_setup.h"
 #include "swrast/s_context.h"
@@ -787,6 +790,12 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
          swrast->choose_line = osmesa_choose_line;
          swrast->choose_triangle = osmesa_choose_triangle;
       }
+
+      _mesa_compute_version(ctx);
+
+      /* Exec table initialization requires the version to be computed */
+      _mesa_initialize_exec_table(ctx);
+      _mesa_initialize_vbo_vtxfmt(ctx);
    }
    return osmesa;
 }
index 50347cf77b992ba4e4da536418fc52a4c14720c8..af9ae6be65b75ba5bbe046b7fd5b3a26ab7778bc 100644 (file)
@@ -12,6 +12,7 @@
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
 #include "main/macros.h"
+#include "main/vtxfmt.h"
 #include "drivers/common/driverfuncs.h"
 #include "drivers/common/meta.h"
 #include "vbo/vbo.h"
@@ -637,6 +638,12 @@ WMesaContext WMesaCreateContext(HDC hDC,
     _swsetup_Wakeup(ctx);
     TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline;
 
+    _mesa_compute_version(ctx);
+
+    /* Exec table initialization requires the version to be computed */
+    _mesa_initialize_exec_table(ctx);
+    _mesa_initialize_vbo_vtxfmt(ctx);
+
     return c;
 }
 
index a466943a86054435a083d479986990da07a43116..0a005f893c5ad87db0ee8c4d8c4eef32465659b0 100644 (file)
@@ -71,6 +71,7 @@
 #include "main/macros.h"
 #include "main/renderbuffer.h"
 #include "main/teximage.h"
+#include "main/vtxfmt.h"
 #include "glapi/glthread.h"
 #include "swrast/swrast.h"
 #include "swrast/s_renderbuffer.h"
@@ -958,6 +959,12 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
 
    _mesa_meta_init(mesaCtx);
 
+   _mesa_compute_version(ctx);
+
+    /* Exec table initialization requires the version to be computed */
+   _mesa_initialize_exec_table(ctx);
+   _mesa_initialize_vbo_vtxfmt(ctx);
+
    return c;
 }
 
index efac9eea49111368c4c2acae5284152b28da0d80..368a30b6871413728406a3ef598ad953947444a9 100644 (file)
 
 #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 "main/vtxfmt.h"
 #include "program/prog_cache.h"
 #include "vbo/vbo.h"
 #include "glapi/glapi.h"
@@ -184,6 +187,11 @@ 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);
+   _mesa_initialize_vbo_vtxfmt(ctx);
+
    return st;
 }
 
index e80f238753b49511b95492b00bd6aaade228f10f..30f5ca5ed1e59347bbf39bd5e0f6d4c51b4553b7 100644 (file)
@@ -647,8 +647,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?
        */
       if (st->ctx->Version < attribs->major * 10 + attribs->minor) {