libglapi.a driver_subdirs
+main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
+ $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES1.1 > $@
+
+main/api_exec_es2.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
+ $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES2.0 > $@
+
######################################################################
# Helper libraries used by many drivers:
@$(MKLIB) -o es2api -static $(ES2_API_OBJECTS)
GENERATED_SOURCES := \
- main/api_exec_es1.c \
- main/api_exec_es2.c \
main/get_es1.c \
main/get_es2.c
-main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
- $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES1.1 > $@
-
-main/api_exec_es2.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
- $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES2.0 > $@
-
main/get_es1.c: main/get_gen.py
$(PYTHON2) $(PYTHON_FLAGS) $< 1 > $@
# LOCAL sources
LOCAL_ES1_SOURCES := \
- main/api_exec_es1.c \
main/get_es1.c \
main/drawtex.c \
main/es_cpaltex.c \
-I$(MESA)/state_tracker
LOCAL_ES2_SOURCES := \
- main/api_exec_es2.c \
main/get_es2.c \
main/es_cpaltex.c \
main/es_fbo.c \
extern struct _glapi_table *
_mesa_create_exec_table(void);
+extern struct _glapi_table *
+_mesa_create_exec_table_es1(void);
+
+extern struct _glapi_table *
+_mesa_create_exec_table_es2(void);
+
#endif
_mesa_get_cpu_features();
- _mesa_init_remap_table();
+ switch (ctx->API) {
+#if FEATURE_GL
+ case API_OPENGL:
+ _mesa_init_remap_table();
+ break;
+#endif
+#if FEATURE_ES1
+ case API_OPENGLES:
+ _mesa_init_remap_table_es1();
+ break;
+#endif
+#if FEATURE_ES2
+ case API_OPENGLES2:
+ _mesa_init_remap_table_es2();
+ break;
+#endif
+ default:
+ break;
+ }
_mesa_init_sqrt_table();
assert(driverFunctions->NewTextureObject);
assert(driverFunctions->FreeTexImageData);
- /* misc one-time initializations */
- one_time_init(ctx);
-
ctx->API = api;
ctx->Visual = *visual;
ctx->DrawBuffer = NULL;
ctx->WinSysDrawBuffer = NULL;
ctx->WinSysReadBuffer = NULL;
+ /* misc one-time initializations */
+ one_time_init(ctx);
+
/* Plug in driver functions and context pointer here.
* This is important because when we call alloc_shared_state() below
* we'll call ctx->Driver.NewTextureObject() to create the default
#if FEATURE_dispatch
/* setup the API dispatch tables */
- ctx->Exec = _mesa_create_exec_table();
+ switch (ctx->API) {
+#if FEATURE_GL
+ case API_OPENGL:
+ ctx->Exec = _mesa_create_exec_table();
+ break;
+#endif
+#if FEATURE_ES1
+ case API_OPENGLES:
+ ctx->Exec = _mesa_create_exec_table_es1();
+ break;
+#endif
+#if FEATURE_ES2
+ case API_OPENGLES2:
+ ctx->Exec = _mesa_create_exec_table_es2();
+ break;
+#endif
+ default:
+ _mesa_problem(ctx, "unknown or unsupported API");
+ break;
+ }
+
if (!ctx->Exec) {
_mesa_release_shared_state(ctx, ctx->Shared);
return GL_FALSE;
'description' : 'GLES1.1 functions',
'header' : 'GLES/gl.h',
'extheader' : 'GLES/glext.h',
+ 'shortname' : 'es1'
},
'GLES2.0': {
'description' : 'GLES2.0 functions',
'header' : 'GLES2/gl2.h',
'extheader' : 'GLES2/gl2ext.h',
+ 'shortname' : 'es2'
}
}
# Grab the version-specific items we need to use
versionHeader = VersionSpecificValues[version]['header']
versionExtHeader = VersionSpecificValues[version]['extheader']
+shortname = VersionSpecificValues[version]['shortname']
# If we get to here, we're good to go. The "version" parameter
# directs GetDispatchedFunctions to only allow functions from
#include "main/compiler.h"
#include "main/api_exec.h"
-
-#include "main/dispatch.h"
-
-#if FEATURE_remap_table
-
#include "main/remap.h"
#ifdef IN_DRI_DRIVER
#define _GLAPI_USE_REMAP_TABLE
#endif
+#include "es/glapi/glapi-%s/glapi/glapitable.h"
+#include "es/glapi/glapi-%s/glapi/glapioffsets.h"
+#include "es/glapi/glapi-%s/glapi/glapidispatch.h"
+
+#if FEATURE_remap_table
+
#define need_MESA_remap_table
-#include "main/remap_helper.h"
+
+#include "es/glapi/glapi-%s/main/remap_helper.h"
void
-_mesa_init_remap_table(void)
+_mesa_init_remap_table_%s(void)
{
_mesa_do_init_remap_table(_mesa_function_pool,
driDispatchRemapTable_size,
}
void
-_mesa_map_static_functions(void)
+_mesa_map_static_functions_%s(void)
{
}
#endif
typedef void (*_glapi_proc)(void); /* generic function pointer */
-"""
+""" % (shortname, shortname, shortname, shortname, shortname, shortname);
# Finally we get to the all-important functions
print """/*************************************************************
# end for each function
-print "struct _glapi_table *"
-print "_mesa_create_exec_table(void)"
-print "{"
-print " struct _glapi_table *exec;"
-print " exec = _mesa_alloc_dispatch_table(sizeof *exec);"
-print " if (exec == NULL)"
-print " return NULL;"
-print ""
+print """
+struct _glapi_table *
+_mesa_create_exec_table_%s(void)
+{
+ struct _glapi_table *exec;
+ exec = _mesa_alloc_dispatch_table(sizeof *exec);
+ if (exec == NULL)
+ return NULL;
+
+""" % shortname
for func in keys:
prefix = "_es_" if func not in allSpecials else "_check_"
_mesa_map_static_functions(void);
extern void
+_mesa_map_static_functions_es1(void);
+
+extern void
+_mesa_map_static_functions_es2(void);
+
+extern void
_mesa_do_init_remap_table(const char *pool,
int size,
const struct gl_function_pool_remap *remap);
extern void
_mesa_init_remap_table(void);
+extern void
+_mesa_init_remap_table_es1(void);
+
+extern void
+_mesa_init_remap_table_es2(void);
+
#else /* FEATURE_remap_table */
static INLINE const char *
{
}
+
+static INLINE void
+_mesa_map_static_functions_es1(void)
+{
+}
+
+static INLINE void
+_mesa_map_static_functions_es2(void)
+{
+}
+
static INLINE void
_mesa_do_init_remap_table(const char *pool,
int size,
{
}
+static INLINE void
+_mesa_init_remap_table_es1(void)
+{
+}
+
+static INLINE void
+_mesa_init_remap_table_es2(void)
+{
+}
+
#endif /* FEATURE_remap_table */
MAIN_SOURCES = \
main/api_arrayelt.c \
main/api_exec.c \
+ main/api_exec_es1.c \
+ main/api_exec_es2.c \
main/api_loopback.c \
main/api_noop.c \
main/api_validate.c \