summaryrefslogtreecommitdiff
path: root/src/mapi/glapi/glapi_getproc.c
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-10-25 22:27:17 +0800
committerChia-I Wu <olv@lunarg.com>2010-10-27 10:49:33 +0800
commite4dbfa44ed018d124e1531077d506c8c914c1a51 (patch)
tree743740c5a73c00c4119d2d30a09ccca67b1505b5 /src/mapi/glapi/glapi_getproc.c
parente213968f2b99b07e20b69e4dd6f94bea35f54161 (diff)
glapi: Do not use glapioffsets.h.
glapioffsets.h exists for the same reason as glapidispatch.h does. It is of no use to glapi. This commit also drops the use of glapioffsets.h in glx as glx is considered an extension to glapi when it comes to defining public GL entries.
Diffstat (limited to 'src/mapi/glapi/glapi_getproc.c')
-rw-r--r--src/mapi/glapi/glapi_getproc.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/mapi/glapi/glapi_getproc.c b/src/mapi/glapi/glapi_getproc.c
index dc4905b64e..47a01176d5 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