[Mesa-dev] [PATCH 11/18] autotools: wire the new generator for es1 and es2

Erik Faye-Lund erik.faye-lund at collabora.com
Thu Dec 6 17:43:06 UTC 2018


On Wed, 2018-11-21 at 12:04 +0000, Emil Velikov wrote:
> The output produced functionally identical, with the following
> changes:
>  - A cosmetic: swapped ABI compatible types [ GLclampf -> GLfloat,
> etc ]
>  - B cosmetic: renamed parameters [ zNear -> n, etc ]
>  - C dropped gl_dispatch_stub declarations - unneeded

You can also apply the following hunk to get rid of them in the old
generator as well:

---8<---
diff --git a/src/mapi/mapi_abi.py b/src/mapi/mapi_abi.py
index dc48fa5935f..87de415e167 100644
--- a/src/mapi/mapi_abi.py
+++ b/src/mapi/mapi_abi.py
@@ -334,7 +334,8 @@ class ABIPrinter(object):
             if not self.need_entry_point(ent):
                 continue
             export = self.api_call if not ent.hidden else ''
-            decls.append(self._c_decl(ent, prefix, True, export) +
';')
+            if not ent.hidden:
+                decls.append(self._c_decl(ent, prefix, True, export) +
';')
 
         return "\n".join(decls)
---8<--- 

>  - D dropped extension entrypoints - invalid/incorrect


I see one more change; the introduction of this array

---8<---
static const mapi_func public_entries[] = {
   (mapi_func) glColor4f,
   (mapi_func) glColor4ub,
   (mapi_func) glNormal3f,
<snip>
   (mapi_func) glPointParameterxv,
   (mapi_func) glTexParameterxv,
};
---8<---

> > To make things easier to validate, normalise both old/new headers
> > run
> the sed patterns A, B and C to both sets.
> 
> A
>   s/\<GLclampf\>/GLfloat/g; s/\<GLclampx\>/GLfixed/g;
>   s/\<GLvoid\>/void/g;
> 
> B
>   s/\ \* / */g; s/\<texture\>/target/g;
>   s/\<plane\>/p/g; s/\<depth\>/d/g; s/\<modeAlpha\>/modeA/g;
>   s/\<shader\>/program/g; s/\<obj\>/shaders/g; s/\<equation\>/eqn/g;
>   s/\<param\>/data/g; s/\<params\>/data/g; s/\<buffers\>/buffer/g;
>   s/\<src\>/mode/g; s/\<count\>/n/g; s/\<zNear\>/n/g; s/\<zFar\>/f/g;
>   s/\<top\>/t/g; s/\<bottom\>/b/g; s/\<left\>/l/g; s/\<right\>/r/g;
>   s/\<x\>/v0/g; s/\<y\>/v1/g; s/\<z\>/v2/g; s/\<w\>/v3/g;
> 
> C
>   /gl_dispatch_stub/d
> 
> D
> glMultiDrawArraysEXT
> glMultiDrawElementsEXT
> 
> glBindFragDataLocationEXT
> 
> glGetTexParameterIivEXT
> glGetTexParameterIuivEXT
> glTexParameterIivEXT
> glTexParameterIuivEXT
> 
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  src/mapi/Makefile.am | 23 +++++++++++++++--------
>  1 file changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/src/mapi/Makefile.am b/src/mapi/Makefile.am
> index 5a619bf049b..daaf46ddb23 100644
> --- a/src/mapi/Makefile.am
> +++ b/src/mapi/Makefile.am
> @@ -63,11 +63,20 @@ include Makefile.sources
>  MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
>  PYTHON_GEN = $(AM_V_GEN)$(PYTHON) $(PYTHON_FLAGS)
>  
> -glapi_gen_mapi_deps := \
> +shared_glapi_gen_mapi_deps := \
>  	mapi_abi.py \
>  	$(wildcard $(top_srcdir)/src/mapi/glapi/gen/*.xml) \
>  	$(wildcard $(top_srcdir)/src/mapi/glapi/gen/*.py)
>  
> +glapi_gen_gl_xml := \
> +	$(srcdir)/glapi/registry/gl.xml
> +glapi_gen_mapi_script = $(srcdir)/new/gen_gldispatch_mapi.py
> +glapi_gen_mapi_deps = \
> +	$(glapi_gen_mapi_script) \
> +	$(srcdir)/new/genCommon.py \
> +	$(glapi_gen_gl_xml)
> +glapi_gen_mapi = $(AM_V_GEN)$(PYTHON) $(PYTHON_FLAGS)
> $(glapi_gen_mapi_script)
> +
>  if HAVE_SHARED_GLAPI
>  BUILT_SOURCES += shared-glapi/glapi_mapi_tmp.h
>  
> @@ -101,7 +110,7 @@ shared_glapi_test_LDADD = \
>  	$(top_builddir)/src/gtest/libgtest.la
>  endif
>  
> -shared-glapi/glapi_mapi_tmp.h : glapi/gen/gl_and_es_API.xml
> $(glapi_gen_mapi_deps)
> +shared-glapi/glapi_mapi_tmp.h : glapi/gen/gl_and_es_API.xml
> $(shared_glapi_gen_mapi_deps)
>  	$(MKDIR_GEN)
>  	$(PYTHON_GEN) $(srcdir)/mapi_abi.py --printer shared-glapi \
>  		$(srcdir)/glapi/gen/gl_and_es_API.xml > $@
> @@ -200,10 +209,9 @@ es1api_libGLESv1_CM_la_LDFLAGS = \
>  es1api_libGLESv1_CM_la_LIBADD += shared-glapi/libglapi.la
>  endif
>  
> -es1api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml
> $(glapi_gen_mapi_deps)
> +es1api/glapi_mapi_tmp.h: $(glapi_gen_mapi_deps)
>  	$(MKDIR_GEN)
> -	$(PYTHON_GEN) $(srcdir)/mapi_abi.py --printer es1api \
> -		$(srcdir)/glapi/gen/gl_and_es_API.xml > $@
> +	$(glapi_gen_mapi) glesv1 $(glapi_gen_gl_xml) > $@
>  
>  if HAVE_OPENGL_ES2
>  TESTS += es2api/ABI-check
> @@ -245,10 +253,9 @@ es2api_libGLESv2_la_LDFLAGS = \
>  es2api_libGLESv2_la_LIBADD += shared-glapi/libglapi.la
>  endif
>  
> -es2api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml
> $(glapi_gen_mapi_deps)
> +es2api/glapi_mapi_tmp.h: $(glapi_gen_mapi_deps)
>  	$(MKDIR_GEN)
> -	$(PYTHON_GEN) $(srcdir)/mapi_abi.py --printer es2api \
> -		$(srcdir)/glapi/gen/gl_and_es_API.xml > $@
> +	$(glapi_gen_mapi) glesv2 $(glapi_gen_gl_xml) > $@
>  
>  include $(top_srcdir)/install-lib-links.mk
>  



More information about the mesa-dev mailing list