diff options
author | Ian Romanick <[email protected]> | 2005-07-28 00:29:51 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2005-07-28 00:29:51 +0000 |
commit | 1585c234e0db4bfb7cd85c4111594f6da1582e6f (patch) | |
tree | 75ead6349c299291829a8a47fe437f6c22bc50da /src/mesa/main | |
parent | 9f23a3a1bff6c8af93e651273c9887bbf119f555 (diff) |
Major rip-up of internal function insertion interface. The oldmesa_6_3_1
_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/main')
-rw-r--r-- | src/mesa/main/mtypes.h | 5 | ||||
-rw-r--r-- | src/mesa/main/vtxfmt.c | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 6c036da8743..956fc9971e8 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2598,7 +2598,10 @@ struct gl_tnl_module * On restore, only need to swap these functions back in. */ /*@{*/ - void *Swapped[NUM_VERTEX_FORMAT_ENTRIES][2]; + struct { + _glapi_proc * location; + _glapi_proc function; + } Swapped[NUM_VERTEX_FORMAT_ENTRIES]; GLuint SwapCount; /*@}*/ }; diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 0d285cb26c9..dcb684837c8 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -49,15 +49,14 @@ { \ GET_CURRENT_CONTEXT(ctx); \ struct gl_tnl_module *tnl = &(ctx->TnlModule); \ - typedef void (*func_ptr_t)(void); \ \ ASSERT( tnl->Current ); \ ASSERT( tnl->SwapCount < NUM_VERTEX_FORMAT_ENTRIES ); \ \ /* Save the swapped function's dispatch entry so it can be */ \ /* restored later. */ \ - tnl->Swapped[tnl->SwapCount][0] = (void *)&(GET_ ## FUNC (ctx->Exec)); \ - *(func_ptr_t *)(tnl->Swapped[tnl->SwapCount]+1) = (func_ptr_t)TAG(FUNC); \ + tnl->Swapped[tnl->SwapCount].location = (_glapi_proc *) & (GET_ ## FUNC (ctx->Exec)); \ + tnl->Swapped[tnl->SwapCount].function = (_glapi_proc)TAG(FUNC); \ tnl->SwapCount++; \ \ if ( 0 ) \ @@ -177,7 +176,7 @@ void _mesa_restore_exec_vtxfmt( GLcontext *ctx ) /* Restore the neutral tnl module wrapper. */ for ( i = 0 ; i < tnl->SwapCount ; i++ ) { - *(void **)tnl->Swapped[i][0] = tnl->Swapped[i][1]; + *(tnl->Swapped[i].location) = tnl->Swapped[i].function; } tnl->SwapCount = 0; |