summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/tdfx
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2005-07-28 00:29:51 +0000
committerIan Romanick <idr@us.ibm.com>2005-07-28 00:29:51 +0000
commit1585c234e0db4bfb7cd85c4111594f6da1582e6f (patch)
tree75ead6349c299291829a8a47fe437f6c22bc50da /src/mesa/drivers/dri/tdfx
parent9f23a3a1bff6c8af93e651273c9887bbf119f555 (diff)
Major rip-up of internal function insertion interface. The old
_glapi_add_entrypoint has been replaced by a new routine called _glapi_add_dispatch. This new routine dynamically assignes dispatch offsets to functions added. This allows IHVs to add support for extension functions that do not have assigned dispatch offsets. It also means that a driver has no idea what offset will be assigned to a function. The vast majority of the changes in this commit account for that. An additional table, driDispatchRemapTable, is added. Functions not in the Linux OpenGL ABI (i.e., anything not in GL 1.2 + ARB_multitexture) has a fixed offset in this new table. The entry in this table specifies the offset in of the function in the real dispatch table. The internal interface was also bumped from version 20050725 to 20050727. This has been tested with various programs in progs/demos on: radeon (Radeon Mobility M6) r128 (Rage 128 Pro) mga (G400)
Diffstat (limited to 'src/mesa/drivers/dri/tdfx')
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_context.c4
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_screen.c16
2 files changed, 17 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c
index 724416197f..d90d4f06b9 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_context.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c
@@ -83,7 +83,7 @@
/**
* Common extension strings exported by all cards
*/
-static const struct dri_extension card_extensions[] =
+const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_texture_mirrored_repeat", NULL },
@@ -123,7 +123,7 @@ static const struct dri_extension card_extensions[] =
/**
* Extension strings exported only by Naplam (e.g., Voodoo4 & Voodoo5) cards.
*/
-static const struct dri_extension napalm_extensions[] =
+const struct dri_extension napalm_extensions[] =
{
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_combine", NULL },
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c
index b373129646..0da4d7e3c2 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c
@@ -65,6 +65,9 @@ DRI_CONF_END;
static const GLuint __driNConfigOptions = 1;
+extern const struct dri_extension card_extensions[];
+extern const struct dri_extension napalm_extensions[];
+
static GLboolean
tdfxCreateScreen( __DRIscreenPrivate *sPriv )
{
@@ -426,7 +429,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits,
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -467,6 +470,17 @@ void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIsc
*driver_modes = tdfxFillInModes(bpp, (bpp == 16) ? 16 : 24,
(bpp == 16) ? 0 : 8,
(dri_priv->backOffset!=dri_priv->depthOffset));
+
+ /* 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 );
+ driInitExtensions( NULL, napalm_extensions, GL_FALSE );
}
return (void *)psp;