Re: [Mesa-dev] [PATCH mesa 3/3] egl: remove dead code in glvnd dispatch generation code

2018-11-07 Thread Emil Velikov
On Wed, 7 Nov 2018 at 13:20, Eric Engestrom  wrote:
>
> g_egldispatchstubs.[ch] are completely identical before and after this
> patch.
>
In theory I agree with the idea here, but I'm quite wary about this.

While the moment nobody uses this code, as we do ... it'll be rather
unlikely that we'll fish through git log and revert.
I suspect that we'll reinvent something new or simply wire the
functions correctly.

How about we improve the comment why/when we'll need this instead?
-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH mesa 3/3] egl: remove dead code in glvnd dispatch generation code

2018-11-07 Thread Kyle Brenneman

On 11/07/2018 06:20 AM, Eric Engestrom wrote:

g_egldispatchstubs.[ch] are completely identical before and after this
patch.

Signed-off-by: Eric Engestrom 
---
  src/egl/generate/eglFunctionList.py  | 203 +++
  src/egl/generate/gen_egl_dispatch.py |  61 ++--
  2 files changed, 91 insertions(+), 173 deletions(-)

diff --git a/src/egl/generate/eglFunctionList.py 
b/src/egl/generate/eglFunctionList.py
index 667704eb2cb46fd06ff2..a480efca0d77a956dd78 100644
--- a/src/egl/generate/eglFunctionList.py
+++ b/src/egl/generate/eglFunctionList.py
@@ -5,36 +5,10 @@
  
  This is used from gen_egl_dispatch.py.
  
-EGL_FUNCTIONS is a sequence of (name, eglData) pairs, where name is the name

-of the function, and eglData is a dictionary containing data about that
-function.
+EGL_FUNCTIONS is a sequence of (name, method) pairs, where name is the name
+of the function, and method is a string describing how to select a vendor
+library for that function:
  
-The values in the eglData dictionary are:

-- method (string):
-How to select a vendor library. See "Method values" below.
-
-- prefix (string):
-This string is prepended to the name of the dispatch function. If
-unspecified, the default is "" (an empty string).
-
-- static (boolean)
-  If True, this function should be declared static.
-
-- "public" (boolean)
-If True, the function should be exported from the library. Vendor libraries
-generally should not use this.
-
-- extension (string):
-If specified, this is the name of a macro to check for before defining a
-function. Used for checking for extension macros and such.
-
-- retval (string):
-If specified, this is a C expression with the default value to return if we
-can't find a function to call. By default, it will try to guess from the
-return type: EGL_NO_whatever for the various handle types, NULL for
-pointers, and zero for everything else.
-
-method values:
  - "custom"
  The dispatch stub will be hand-written instead of generated.
  
@@ -53,158 +27,139 @@

  Select the vendor that owns the current context.
  """
  
-def _eglFunc(name, method, static=None, public=False, inheader=None, prefix="dispatch_", extension=None, retval=None):

-"""
-A convenience function to define an entry in the EGL function list.
-"""
-if static is None:
-static = (not public and method != "custom")
-if inheader is None:
-inheader = (not static)
-values = {
-"method" : method,
-"prefix" : prefix,
-"extension" : extension,
-"retval" : retval,
-"static" : static,
-"public" : public,
-"inheader" : inheader,
-}
-return (name, values)
-
  EGL_FUNCTIONS = (
  # EGL_VERSION_1_0
-_eglFunc("eglChooseConfig",  "none"),
-_eglFunc("eglCopyBuffers",   "none"),
-_eglFunc("eglCreateContext", "none"),
-_eglFunc("eglCreatePbufferSurface",  "none"),
-_eglFunc("eglCreatePixmapSurface",   "none"),
-_eglFunc("eglCreateWindowSurface",   "none"),
-_eglFunc("eglDestroyContext","none"),
-_eglFunc("eglDestroySurface","none"),
-_eglFunc("eglGetConfigAttrib",   "none"),
-_eglFunc("eglGetConfigs","none"),
-_eglFunc("eglQueryContext",  "none"),
-_eglFunc("eglQuerySurface",  "none"),
-_eglFunc("eglSwapBuffers",   "none"),
-_eglFunc("eglWaitGL","none"),
-_eglFunc("eglWaitNative","none"),
-_eglFunc("eglTerminate", "none"),
-_eglFunc("eglInitialize","none"),
+("eglChooseConfig",  "none"),
+("eglCopyBuffers",   "none"),
+("eglCreateContext", "none"),
+("eglCreatePbufferSurface",  "none"),
+("eglCreatePixmapSurface",   "none"),
+("eglCreateWindowSurface",   "none"),
+("eglDestroyContext","none"),
+("eglDestroySurface","none"),
+("eglGetConfigAttrib",   "none"),
+("eglGetConfigs","none"),
+("eglQueryContext",  "none"),
+("eglQuerySurface",  "none"),
+("eglSwapBuffers",   "none"),
+("eglWaitGL","none"),
+("eglWaitNative","none"),
+("eglTerminate", "none"),
+("eglInitialize","none"),
  
-_eglFunc("eglGetCurrentDisplay", "none"),

-_eglFunc("eglGetCurrentSurface", "none"),
-_eglFunc("eglGetDisplay","none"),
-_eglFunc("eglGe

[Mesa-dev] [PATCH mesa 3/3] egl: remove dead code in glvnd dispatch generation code

2018-11-07 Thread Eric Engestrom
g_egldispatchstubs.[ch] are completely identical before and after this
patch.

Signed-off-by: Eric Engestrom 
---
 src/egl/generate/eglFunctionList.py  | 203 +++
 src/egl/generate/gen_egl_dispatch.py |  61 ++--
 2 files changed, 91 insertions(+), 173 deletions(-)

diff --git a/src/egl/generate/eglFunctionList.py 
b/src/egl/generate/eglFunctionList.py
index 667704eb2cb46fd06ff2..a480efca0d77a956dd78 100644
--- a/src/egl/generate/eglFunctionList.py
+++ b/src/egl/generate/eglFunctionList.py
@@ -5,36 +5,10 @@
 
 This is used from gen_egl_dispatch.py.
 
-EGL_FUNCTIONS is a sequence of (name, eglData) pairs, where name is the name
-of the function, and eglData is a dictionary containing data about that
-function.
+EGL_FUNCTIONS is a sequence of (name, method) pairs, where name is the name
+of the function, and method is a string describing how to select a vendor
+library for that function:
 
-The values in the eglData dictionary are:
-- method (string):
-How to select a vendor library. See "Method values" below.
-
-- prefix (string):
-This string is prepended to the name of the dispatch function. If
-unspecified, the default is "" (an empty string).
-
-- static (boolean)
-  If True, this function should be declared static.
-
-- "public" (boolean)
-If True, the function should be exported from the library. Vendor libraries
-generally should not use this.
-
-- extension (string):
-If specified, this is the name of a macro to check for before defining a
-function. Used for checking for extension macros and such.
-
-- retval (string):
-If specified, this is a C expression with the default value to return if we
-can't find a function to call. By default, it will try to guess from the
-return type: EGL_NO_whatever for the various handle types, NULL for
-pointers, and zero for everything else.
-
-method values:
 - "custom"
 The dispatch stub will be hand-written instead of generated.
 
@@ -53,158 +27,139 @@
 Select the vendor that owns the current context.
 """
 
-def _eglFunc(name, method, static=None, public=False, inheader=None, 
prefix="dispatch_", extension=None, retval=None):
-"""
-A convenience function to define an entry in the EGL function list.
-"""
-if static is None:
-static = (not public and method != "custom")
-if inheader is None:
-inheader = (not static)
-values = {
-"method" : method,
-"prefix" : prefix,
-"extension" : extension,
-"retval" : retval,
-"static" : static,
-"public" : public,
-"inheader" : inheader,
-}
-return (name, values)
-
 EGL_FUNCTIONS = (
 # EGL_VERSION_1_0
-_eglFunc("eglChooseConfig",  "none"),
-_eglFunc("eglCopyBuffers",   "none"),
-_eglFunc("eglCreateContext", "none"),
-_eglFunc("eglCreatePbufferSurface",  "none"),
-_eglFunc("eglCreatePixmapSurface",   "none"),
-_eglFunc("eglCreateWindowSurface",   "none"),
-_eglFunc("eglDestroyContext","none"),
-_eglFunc("eglDestroySurface","none"),
-_eglFunc("eglGetConfigAttrib",   "none"),
-_eglFunc("eglGetConfigs","none"),
-_eglFunc("eglQueryContext",  "none"),
-_eglFunc("eglQuerySurface",  "none"),
-_eglFunc("eglSwapBuffers",   "none"),
-_eglFunc("eglWaitGL","none"),
-_eglFunc("eglWaitNative","none"),
-_eglFunc("eglTerminate", "none"),
-_eglFunc("eglInitialize","none"),
+("eglChooseConfig",  "none"),
+("eglCopyBuffers",   "none"),
+("eglCreateContext", "none"),
+("eglCreatePbufferSurface",  "none"),
+("eglCreatePixmapSurface",   "none"),
+("eglCreateWindowSurface",   "none"),
+("eglDestroyContext","none"),
+("eglDestroySurface","none"),
+("eglGetConfigAttrib",   "none"),
+("eglGetConfigs","none"),
+("eglQueryContext",  "none"),
+("eglQuerySurface",  "none"),
+("eglSwapBuffers",   "none"),
+("eglWaitGL","none"),
+("eglWaitNative","none"),
+("eglTerminate", "none"),
+("eglInitialize","none"),
 
-_eglFunc("eglGetCurrentDisplay", "none"),
-_eglFunc("eglGetCurrentSurface", "none"),
-_eglFunc("eglGetDisplay","none"),
-_eglFunc("eglGetError",  "none"),
-_eglFunc("eglGetProc