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.
This commit is contained in:
Chia-I Wu
2010-10-25 22:27:17 +08:00
parent e213968f2b
commit e4dbfa44ed
10 changed files with 3110 additions and 3124 deletions

View File

@@ -440,6 +440,7 @@ extern HIDDEN void __indirect_glGetConvolutionParameteriv(GLenum target, GLenum
extern HIDDEN void gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params);
extern HIDDEN void __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span);
extern HIDDEN void gl_dispatch_stub_359(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span);
#define gl_dispatch_stub_GetSeparableFilterEXT gl_dispatch_stub_359
extern HIDDEN void __indirect_glSeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column);
extern HIDDEN void __indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
extern HIDDEN void gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);

View File

@@ -33,7 +33,6 @@
#include "glapitable.h"
#include "glapi.h"
#include "glthread.h"
#include "glapioffsets.h"
#include <GL/glxproto.h>
void
@@ -109,10 +108,8 @@ __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
}
#define CONCAT(a,b) a ## b
#define NAME(o) CONCAT(gl_dispatch_stub_, o)
void NAME(_gloffset_GetSeparableFilter) (GLenum target, GLenum format,
/* it is defined to gl_dispatch_stub_NNN in indirect.h */
void gl_dispatch_stub_GetSeparableFilterEXT (GLenum target, GLenum format,
GLenum type, GLvoid * row,
GLvoid * column, GLvoid * span)
{

View File

@@ -993,6 +993,9 @@ extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest(
asdf = func.static_glx_name(n)
if asdf not in func.static_entry_points:
print 'extern HIDDEN %s gl%s(%s);' % (func.return_type, asdf, params)
# give it a easy-to-remember name
if func.client_handcode:
print '#define gl_dispatch_stub_%s gl%s' % (n, asdf)
else:
print 'GLAPI %s GLAPIENTRY gl%s(%s);' % (func.return_type, asdf, params)

View File

@@ -39,8 +39,6 @@ class PrintGenericStubs(gl_XML.gl_print_base):
def printRealHeader(self):
print '#include "glapi/glapioffsets.h"'
print ''
print '#ifdef __arch64__'
print '#define GL_OFF(N)\t((N) * 8)'
print '#define GL_LL\t\tldx'
@@ -223,7 +221,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
for f in api.functionIterateByOffset():
name = f.dispatch_name()
print '\tGL_STUB(gl%s, _gloffset_%s)' % (name, f.name)
print '\tGL_STUB(gl%s, %d)' % (name, f.offset)
if not f.is_static_entry_point(f.name):
print '\tHIDDEN(gl%s)' % (name)

View File

@@ -96,7 +96,7 @@ typedef struct {
for func in api.functionIterateByOffset():
name = func.dispatch_name()
self.printFunctionString(func.name)
table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name))
table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.offset))
# The length of the function's name, plus 2 for "gl",
# plus 1 for the NUL.
@@ -112,9 +112,9 @@ typedef struct {
if func.has_different_protocol(n):
alt_name = "gl" + func.static_glx_name(n)
table.append((base_offset, "gl" + name, alt_name, alt_name, func.name))
table.append((base_offset, "gl" + name, alt_name, alt_name, func.offset))
else:
table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name))
table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.offset))
base_offset += len(n) + 3
@@ -170,7 +170,7 @@ typedef struct {
print 'static const glprocs_table_t static_functions[] = {'
for info in table:
print ' NAME_FUNC_OFFSET(%5u, %s, %s, %s, _gloffset_%s),' % info
print ' NAME_FUNC_OFFSET(%5u, %s, %s, %s, %d),' % info
print ' NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)'
print '};'

View File

@@ -54,7 +54,6 @@ class PrintGenericStubs(gl_XML.gl_print_base):
def printRealHeader(self):
print '#include "x86/assyntax.h"'
print '#include "glapi/glapioffsets.h"'
print ''
print '#if defined(STDCALL_API)'
print '# if defined(USE_MGL_NAMESPACE)'
@@ -215,7 +214,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
stack = self.get_stack_size(f)
alt = "%s@%u" % (name, stack)
print '\tGL_STUB(%s, _gloffset_%s, %s)' % (name, f.name, alt)
print '\tGL_STUB(%s, %d, %s)' % (name, f.offset, alt)
if not f.is_static_entry_point(f.name):
print '\tHIDDEN(GL_PREFIX(%s, %s))' % (name, alt)
@@ -230,7 +229,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
if f.is_static_entry_point(n):
if n != f.name:
alt2 = "%s@%u" % (n, stack)
text = '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, name, alt)
text = '\tGL_STUB_ALIAS(%s, %d, %s, %s, %s)' % (n, f.offset, alt2, name, alt)
if f.has_different_protocol(n):
print '#ifndef GLX_INDIRECT_RENDERING'

View File

@@ -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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff