[Mesa-dev] [PATCH 5/6] glapi: generate ES dispatch headers from core mesa
Chia-I Wu
olvaffe at gmail.com
Thu Aug 11 02:45:25 PDT 2011
From: Chia-I Wu <olv at lunarg.com>
GLESv1 and GLESv2 have their own dispatch.h and remap_helper.h. These
headers are only used by api_exec_es1.c and api_exec_es2.c in core mesa.
Move the rules to generate them from glapi to core mesa.
---
src/mapi/es1api/Makefile | 9 +--------
src/mesa/Makefile | 19 +++++++++++++++++++
src/mesa/main/es_generator.py | 4 ++--
3 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/src/mapi/es1api/Makefile b/src/mapi/es1api/Makefile
index df2a681..7e29e7a 100644
--- a/src/mapi/es1api/Makefile
+++ b/src/mapi/es1api/Makefile
@@ -48,7 +48,7 @@ esapi_CPPFLAGS += -DMAPI_MODE_BRIDGE
esapi_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(esapi_LIB_DEPS)
.PHONY: default
-default: depend $(TOP)/$(LIB_DIR)/$(esapi_LIB_NAME) main/dispatch.h main/remap_helper.h
+default: depend $(TOP)/$(LIB_DIR)/$(esapi_LIB_NAME)
$(TOP)/$(LIB_DIR)/$(esapi_LIB_NAME): $(esapi_OBJECTS)
$(MKLIB) -o $(esapi_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
@@ -72,12 +72,6 @@ include $(GLAPI)/gen/glapi_gen.mk
glapi_mapi_tmp.h: $(GLAPI)/gen/gl_and_es_API.xml $(glapi_mapi_deps)
$(call glapi_mapi_gen,$<,$(ESAPI))
-main/dispatch.h: $(GLAPI)/gen/gl_and_es_API.xml $(glapi_dispatch_deps)
- $(call glapi_dispatch_gen,$<,$(ES))
-
-main/remap_helper.h: $(GLAPI)/gen/gl_and_es_API.xml $(glapi_remap_helper_deps)
- $(call glapi_remap_helper_gen,$<,$(ES))
-
.PHONY: clean
clean:
-rm -f $(esapi_PC)
@@ -86,7 +80,6 @@ clean:
-rm -f $(esapi_OBJECTS)
-rm -f depend depend.bak
-rm -f glapi_mapi_tmp.h
- -rm -rf main
pcedit = \
-e 's, at INSTALL_DIR@,$(INSTALL_DIR),' \
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index 88f31b6..7e011f7 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -67,6 +67,25 @@ $(DRICORE_OBJ_DIR)/%.o: %.S
# then convenience libs (.a) and finally the device drivers:
default: $(DEPENDS) asm_subdirs $(MESA_LIBS) $(DRICORE_LIBS) driver_subdirs
+GLAPI := $(TOP)/src/mapi/glapi/gen
+include $(GLAPI)/glapi_gen.mk
+
+main/api_exec_es1_dispatch.h: $(GLAPI)/gl_and_es_API.xml $(glapi_dispatch_deps)
+ $(call glapi_dispatch_gen,$<,es1)
+
+main/api_exec_es1_remap_helper.h: $(GLAPI)/gl_and_es_API.xml $(glapi_remap_helper_deps)
+ $(call glapi_remap_helper_gen,$<,es1)
+
+main/api_exec_es1.o: main/api_exec_es1_dispatch.h main/api_exec_es1_remap_helper.h
+
+main/api_exec_es2_dispatch.h: $(GLAPI)/gl_and_es_API.xml $(glapi_dispatch_deps)
+ $(call glapi_dispatch_gen,$<,es2)
+
+main/api_exec_es2_remap_helper.h: $(GLAPI)/gl_and_es_API.xml $(glapi_remap_helper_deps)
+ $(call glapi_remap_helper_gen,$<,es2)
+
+main/api_exec_es2.o: main/api_exec_es2_dispatch.h main/api_exec_es2_remap_helper.h
+
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 > $@
diff --git a/src/mesa/main/es_generator.py b/src/mesa/main/es_generator.py
index c0b0a44..cad3dea 100644
--- a/src/mesa/main/es_generator.py
+++ b/src/mesa/main/es_generator.py
@@ -681,10 +681,10 @@ print """
#if FEATURE_remap_table
/* define esLocalRemapTable */
-#include "%sapi/main/dispatch.h"
+#include "main/api_exec_%s_dispatch.h"
#define need_MESA_remap_table
-#include "%sapi/main/remap_helper.h"
+#include "main/api_exec_%s_remap_helper.h"
static void
init_remap_table(void)
--
1.7.5.4
More information about the mesa-dev
mailing list