With
07b85457d95bcc70588584e9380c51cd63aa3a2b, glapitable.h is included
by core mesa only to know the size of _glapi_table. It is not necessary
as the same info is given by _gloffset_COUNT.
This change makes _glapi_table opaque to core mesa. All operations on
it are supposed to go through one of the SET/GET/CALL macros.
{
struct _glapi_table *exec;
- exec = _mesa_alloc_dispatch_table(sizeof *exec);
+ exec = _mesa_alloc_dispatch_table(_gloffset_COUNT);
if (exec == NULL)
return NULL;
#include "api_loopback.h"
#include "mtypes.h"
#include "glapi/glapi.h"
-#include "glapi/glapitable.h"
#include "glapi/glthread.h"
#include "main/dispatch.h"
* Mesa we do this to accomodate different versions of libGL and various
* DRI drivers.
*/
- GLint numEntries = MAX2(_glapi_get_dispatch_table_size(),
- size / sizeof(_glapi_proc));
+ GLint numEntries = MAX2(_glapi_get_dispatch_table_size(), size);
struct _glapi_table *table =
(struct _glapi_table *) malloc(numEntries * sizeof(_glapi_proc));
if (table) {
#define _GLAPI_USE_REMAP_TABLE
#endif
-#include "glapi/glapitable.h"
#include "main/glapidispatch.h"
#endif /* _DISPATCH_H */
{
struct _glapi_table *table;
- table = _mesa_alloc_dispatch_table(sizeof *table);
+ table = _mesa_alloc_dispatch_table(_gloffset_COUNT);
if (table == NULL)
return NULL;
#ifndef GLAPIENTRY
#define GLAPIENTRY GL_APIENTRY
#endif
-#include "%sapi/glapi/glapitable.h"
#include "%sapi/main/glapidispatch.h"
#if FEATURE_remap_table
#endif
typedef void (*_glapi_proc)(void); /* generic function pointer */
-""" % (shortname, shortname, shortname, shortname, shortname);
+""" % (shortname, shortname, shortname, shortname);
# Finally we get to the all-important functions
print """/*************************************************************
_mesa_create_exec_table_%s(void)
{
struct _glapi_table *exec;
- exec = _mesa_alloc_dispatch_table(sizeof *exec);
+ exec = _mesa_alloc_dispatch_table(_gloffset_COUNT);
if (exec == NULL)
return NULL;