[Piglit] [PATCH 12/29] glapi: Make json enums have complete name

Paul Berry stereotype441 at gmail.com
Fri May 25 09:28:39 PDT 2012


On 21 May 2012 11:08, Pauli Nieminen <pauli.nieminen at linux.intel.com> wrote:

> Enums need to have complete name to allow mixing EGL and GL enums. Add
> GL_ prefix to spec enums.
>

Can you update the documentation at the top of parse_glspec.py to reflect
this change?  This line needs to change:

#     <enum name, without "GL_" prefix>: {


>
> Signed-off-by: Pauli Nieminen <pauli.nieminen at linux.intel.com>
> ---
>  glapi/parse_glspec.py      |    4 +++-
>  tests/util/gen_dispatch.py |    2 +-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/glapi/parse_glspec.py b/glapi/parse_glspec.py
> index 9d7d523..16842a6 100644
> --- a/glapi/parse_glspec.py
> +++ b/glapi/parse_glspec.py
> @@ -461,8 +461,10 @@ class Api(object):
>     #                             'value_str': "0xFFFFFFFF" }
>     def parse_enum(self, m):
>        name, value = m.groups()
> +       if not name.startswith('GL_'):
> +           name = 'GL_' + name
>        if value.startswith('GL_'):
> -           value_rhs = value[3:]
> +           value_rhs = value
>            value_int = self.enums[value_rhs]['value_int']
>        else:
>            value_int = decode_enum_value(value)
> diff --git a/tests/util/gen_dispatch.py b/tests/util/gen_dispatch.py
> index 345260a..63649bc 100644
> --- a/tests/util/gen_dispatch.py
> +++ b/tests/util/gen_dispatch.py
> @@ -620,7 +620,7 @@ def generate_code(api):
>
>     # Emit enum #defines
>     for name, value in api.compute_unique_enums():
> -       h_contents.append('#define GL_{0} {1}\n'.format(name, value))
> +       h_contents.append('#define {0} {1}\n'.format(name, value))
>
>     # Emit extension #defines
>     h_contents.append('\n')
> --
> 1.7.5.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20120525/e64df955/attachment.htm>


More information about the Piglit mailing list