diff options
author | Chia-I Wu <[email protected]> | 2010-10-29 12:45:04 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-10-29 12:46:59 +0800 |
commit | 9de5c6a1cb1428154c371f4331b55b5161957b50 (patch) | |
tree | d4a40efee4d53646fb0350c7e4cf1472bd42a98c /src/mapi/glapi/glapi_getproc.c | |
parent | 815faa448cccc38aebb1b60ecf0bd7e6bf8f277e (diff) | |
parent | b762db62c2972506fa78a5ed72f796113fc9b0d1 (diff) |
Merge branch 'glapi-reorg'
Conflicts:
src/mapi/glapi/glapi_sparc.S
src/mapi/glapi/glapi_x86.S
src/mapi/glapi/glapidispatch.h
src/mapi/glapi/glapioffsets.h
src/mapi/glapi/glprocs.h
Diffstat (limited to 'src/mapi/glapi/glapi_getproc.c')
-rw-r--r-- | src/mapi/glapi/glapi_getproc.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/src/mapi/glapi/glapi_getproc.c b/src/mapi/glapi/glapi_getproc.c index dc4905b64e0..47a01176d5a 100644 --- a/src/mapi/glapi/glapi_getproc.c +++ b/src/mapi/glapi/glapi_getproc.c @@ -32,7 +32,9 @@ #include "glapi/glapi_priv.h" #include "glapi/glapitable.h" -#include "glapi/glapioffsets.h" + + +#define FIRST_DYNAMIC_OFFSET (sizeof(struct _glapi_table) / sizeof(void *)) /********************************************************************** @@ -382,7 +384,7 @@ int _glapi_add_dispatch( const char * const * function_names, const char * parameter_signature ) { - static int next_dynamic_offset = _gloffset_FIRST_DYNAMIC; + static int next_dynamic_offset = FIRST_DYNAMIC_OFFSET; const char * const real_sig = (parameter_signature != NULL) ? parameter_signature : ""; struct _glapi_function * entry[8]; @@ -576,15 +578,6 @@ _glapi_get_proc_name(GLuint offset) */ -/* - * The dispatch table size (number of entries) is the size of the - * _glapi_table struct plus the number of dynamic entries we can add. - * The extra slots can be filled in by DRI drivers that register new extension - * functions. - */ -#define DISPATCH_TABLE_SIZE (sizeof(struct _glapi_table) / sizeof(void *) + MAX_EXTENSION_FUNCS) - - /** * Return size of dispatch table struct as number of functions (or * slots). @@ -592,7 +585,13 @@ _glapi_get_proc_name(GLuint offset) GLuint _glapi_get_dispatch_table_size(void) { - return DISPATCH_TABLE_SIZE; + /* + * The dispatch table size (number of entries) is the size of the + * _glapi_table struct plus the number of dynamic entries we can add. + * The extra slots can be filled in by DRI drivers that register new + * extension functions. + */ + return FIRST_DYNAMIC_OFFSET + MAX_EXTENSION_FUNCS; } @@ -628,56 +627,48 @@ _glapi_check_table(const struct _glapi_table *table) GLuint BeginOffset = _glapi_get_proc_offset("glBegin"); char *BeginFunc = (char*) &table->Begin; GLuint offset = (BeginFunc - (char *) table) / sizeof(void *); - assert(BeginOffset == _gloffset_Begin); assert(BeginOffset == offset); } { GLuint viewportOffset = _glapi_get_proc_offset("glViewport"); char *viewportFunc = (char*) &table->Viewport; GLuint offset = (viewportFunc - (char *) table) / sizeof(void *); - assert(viewportOffset == _gloffset_Viewport); assert(viewportOffset == offset); } { GLuint VertexPointerOffset = _glapi_get_proc_offset("glVertexPointer"); char *VertexPointerFunc = (char*) &table->VertexPointer; GLuint offset = (VertexPointerFunc - (char *) table) / sizeof(void *); - assert(VertexPointerOffset == _gloffset_VertexPointer); assert(VertexPointerOffset == offset); } { GLuint ResetMinMaxOffset = _glapi_get_proc_offset("glResetMinmax"); char *ResetMinMaxFunc = (char*) &table->ResetMinmax; GLuint offset = (ResetMinMaxFunc - (char *) table) / sizeof(void *); - assert(ResetMinMaxOffset == _gloffset_ResetMinmax); assert(ResetMinMaxOffset == offset); } { GLuint blendColorOffset = _glapi_get_proc_offset("glBlendColor"); char *blendColorFunc = (char*) &table->BlendColor; GLuint offset = (blendColorFunc - (char *) table) / sizeof(void *); - assert(blendColorOffset == _gloffset_BlendColor); assert(blendColorOffset == offset); } { GLuint secondaryColor3fOffset = _glapi_get_proc_offset("glSecondaryColor3fEXT"); char *secondaryColor3fFunc = (char*) &table->SecondaryColor3fEXT; GLuint offset = (secondaryColor3fFunc - (char *) table) / sizeof(void *); - assert(secondaryColor3fOffset == _gloffset_SecondaryColor3fEXT); assert(secondaryColor3fOffset == offset); } { GLuint pointParameterivOffset = _glapi_get_proc_offset("glPointParameterivNV"); char *pointParameterivFunc = (char*) &table->PointParameterivNV; GLuint offset = (pointParameterivFunc - (char *) table) / sizeof(void *); - assert(pointParameterivOffset == _gloffset_PointParameterivNV); assert(pointParameterivOffset == offset); } { GLuint setFenceOffset = _glapi_get_proc_offset("glSetFenceNV"); char *setFenceFunc = (char*) &table->SetFenceNV; GLuint offset = (setFenceFunc - (char *) table) / sizeof(void *); - assert(setFenceOffset == _gloffset_SetFenceNV); assert(setFenceOffset == offset); } #else |