[Piglit] [PATCH 12/29] glapi: Make json enums have complete name
Pauli Nieminen
pauli.nieminen at linux.intel.com
Mon May 21 11:08:47 PDT 2012
Enums need to have complete name to allow mixing EGL and GL enums. Add
GL_ prefix to spec enums.
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
More information about the Piglit
mailing list