Fix a missed merge for idr's dispatch changes: failure to do driInitExtensions
authorEric Anholt <anholt@FreeBSD.org>
Wed, 19 Oct 2005 02:46:42 +0000 (02:46 +0000)
committerEric Anholt <anholt@FreeBSD.org>
Wed, 19 Oct 2005 02:46:42 +0000 (02:46 +0000)
in __driCreateNewScreen_20050727 resulted in crashing in dispatch.

src/mesa/drivers/dri/mach64/mach64_context.c
src/mesa/drivers/dri/mach64/mach64_screen.c

index d5098ecaee210bb39549126cb01a48031e8df3a8..717b9b9e8d8a099958a2ce1be6659788f9bb55af 100644 (file)
@@ -79,7 +79,7 @@ static const struct dri_debug_control debug_control[] =
     { NULL,    0 }
 };
 
-static const struct dri_extension card_extensions[] =
+const struct dri_extension card_extensions[] =
 {
     { "GL_ARB_multisample",                GL_ARB_multisample_functions },
     { "GL_ARB_multitexture",               NULL },
index 6d148d3288ab4045cf6a6fc9b756411965fce735..60055e5c9f8f6b38fcce7b297175db020357f0eb 100644 (file)
@@ -67,6 +67,7 @@ static const GLuint __driNConfigOptions = 3;
 static const GLuint __driNConfigOptions = 2;
 #endif
 
+extern const struct dri_extension card_extensions[];
 
 static __GLcontextModes * fill_in_modes( __GLcontextModes * modes,
                                         unsigned pixel_bits, 
@@ -540,6 +541,16 @@ void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIsc
                                         16,
                                         0,
                                         1);
+
+      /* Calling driInitExtensions here, with a NULL context pointer, does not actually
+       * enable the extensions.  It just makes sure that all the dispatch offsets for all
+       * the extensions that *might* be enables are known.  This is needed because the
+       * dispatch offsets need to be known when _mesa_context_create is called, but we can't
+       * enable the extensions until we have a context pointer.
+       *
+       * Hello chicken.  Hello egg.  How are you two today?
+       */
+      driInitExtensions( NULL, card_extensions, GL_FALSE );
    }
 
    return (void *) psp;