intel: Always use intelInitExtensions() for initializing extensions.
authorKristian Høgsberg <krh@redhat.com>
Wed, 27 Feb 2008 16:19:29 +0000 (11:19 -0500)
committerKristian Høgsberg <krh@redhat.com>
Wed, 27 Feb 2008 16:24:29 +0000 (11:24 -0500)
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_screen.c

index 2d32f1d..349b8be 100644 (file)
  * Mesa's Driver Functions
  ***************************************/
 
-static const struct dri_extension brw_extensions[] =
-{
-    { "GL_ARB_depth_texture",              NULL },
-    { "GL_ARB_fragment_program",           NULL },
-    { "GL_ARB_shadow",                     NULL },
-    { "GL_EXT_shadow_funcs",               NULL },
-    /* ARB extn won't work if not enabled */
-    { "GL_SGIX_depth_texture",             NULL },
-    { "GL_ARB_texture_env_crossbar",       NULL },
-    { NULL,                                NULL }
-};
-
 static void brwUseProgram(GLcontext *ctx, GLuint program)
 {
         struct brw_context *brw = brw_context(ctx);
@@ -176,9 +164,6 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
    
 /*    ctx->Const.MaxNativeVertexProgramTemps = 32; */
 
-
-   driInitExtensions( ctx, brw_extensions, GL_FALSE );
-
    brw_init_attribs( brw );
    brw_init_metaops( brw );
    brw_init_state( brw );
index d5cb07d..7e39f68 100644 (file)
@@ -189,7 +189,7 @@ intelGetString(GLcontext * ctx, GLenum name)
  * It appears that ARB_texture_env_crossbar has "disappeared" compared to the
  * old i830-specific driver.
  */
-const struct dri_extension card_extensions[] = {
+static const struct dri_extension card_extensions[] = {
    {"GL_ARB_multisample", GL_ARB_multisample_functions},
    {"GL_ARB_multitexture", NULL},
    {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions},
@@ -243,22 +243,29 @@ const struct dri_extension card_extensions[] = {
    {NULL, NULL}
 };
 
-const struct dri_extension brw_extensions[] = {
+static const struct dri_extension brw_extensions[] = {
    { "GL_ARB_shading_language_100",       GL_VERSION_2_0_functions},
    { "GL_ARB_shading_language_120",       GL_VERSION_2_1_functions},
    { "GL_ARB_shader_objects",             GL_ARB_shader_objects_functions},
    { "GL_ARB_vertex_shader",              GL_ARB_vertex_shader_functions},
    { "GL_ARB_fragment_shader",            NULL },
    { "GL_ARB_draw_buffers",               NULL },
-   {NULL, NULL}
+   { "GL_ARB_depth_texture",              NULL },
+   { "GL_ARB_fragment_program",           NULL },
+   { "GL_ARB_shadow",                     NULL },
+   { "GL_EXT_shadow_funcs",               NULL },
+   /* ARB extn won't work if not enabled */
+   { "GL_SGIX_depth_texture",             NULL },
+   { "GL_ARB_texture_env_crossbar",       NULL },
+   { NULL,                                NULL }
 };
 
-const struct dri_extension arb_oc_extensions[] = {
+static const struct dri_extension arb_oc_extensions[] = {
    {"GL_ARB_occlusion_query",            GL_ARB_occlusion_query_functions},
    {NULL, NULL}
 };
 
-const struct dri_extension ttm_extensions[] = {
+static const struct dri_extension ttm_extensions[] = {
    {"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions},
    {"GL_ARB_pixel_buffer_object", NULL},
    {NULL, NULL}
@@ -268,7 +275,7 @@ const struct dri_extension ttm_extensions[] = {
  * Initializes potential list of extensions if ctx == NULL, or actually enables
  * extensions for a context.
  */
-static void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging)
+void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging)
 {
    struct intel_context *intel = ctx?intel_context(ctx):NULL;
 
index 818856d..6c97955 100644 (file)
@@ -416,6 +416,7 @@ extern void intelFinish(GLcontext * ctx);
 extern void intelFlush(GLcontext * ctx);
 
 extern void intelInitDriverFunctions(struct dd_function_table *functions);
+extern void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging);
 
 
 /* ================================================================
index 8dec808..5d0bf4a 100644 (file)
@@ -72,12 +72,6 @@ const GLuint __driNConfigOptions = 5;
 static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
 #endif /*USE_NEW_INTERFACE */
 
-extern const struct dri_extension card_extensions[];
-extern const struct dri_extension ttm_extensions[];
-#ifndef I915
-extern const struct dri_extension arb_oc_extensions[];
-#endif
-
 /**
  * Map all the memory regions described by the screen.
  * \return GL_TRUE if success, GL_FALSE if error.
@@ -803,12 +797,8 @@ PUBLIC __GLcontextModes *__driDriverInitScreen(__DRIscreenPrivate *psp)
     *
     * Hello chicken.  Hello egg.  How are you two today?
     */
-   driInitExtensions(NULL, card_extensions, GL_FALSE);
-   driInitExtensions(NULL, ttm_extensions, GL_FALSE);
-#ifndef I915
-   driInitExtensions(NULL, arb_oc_extensions, GL_FALSE);
-#endif
-
+   intelInitExtensions(NULL, GL_TRUE);
+          
    if (!intelInitDriver(psp))
        return NULL;
 
@@ -865,8 +855,7 @@ PUBLIC __GLcontextModes *__dri2DriverInitScreen(__DRIscreenPrivate *psp)
     *
     * Hello chicken.  Hello egg.  How are you two today?
     */
-   driInitExtensions(NULL, card_extensions, GL_FALSE);
-   driInitExtensions(NULL, ttm_extensions, GL_FALSE);
+   intelInitExtensions(NULL, GL_TRUE);
 
    /* Allocate the private area */
    intelScreen = (intelScreenPrivate *) CALLOC(sizeof(intelScreenPrivate));