[Piglit] [PATCH 2/2] Include enum.spec along with enumext.spec for piglit-dispatch.
Eric Anholt
eric at anholt.net
Tue May 28 13:46:59 PDT 2013
There are three differences between the two (as verified by sort, sed,
uniq, and diff):
- enum.spec includes GLES extension enums (since it's used for
maintaining uniqueness of enums in the registry), which we want to
include for cross-API compatibility.
- enum.spec includes entries for known GL versions and GL extensions.
- enumext.spec has a few more synonyms for enums (since it's the
file used for generating the official glext.h for desktop).
This change only introduces new #define lines to generated-dispatch.h.
---
cmake/piglit_glapi.cmake | 1 +
glapi/parse_glspec.py | 4 +++-
tests/util/gen_dispatch.py | 33 ++-------------------------------
3 files changed, 6 insertions(+), 32 deletions(-)
diff --git a/cmake/piglit_glapi.cmake b/cmake/piglit_glapi.cmake
index bdc0390..368c1ca 100644
--- a/cmake/piglit_glapi.cmake
+++ b/cmake/piglit_glapi.cmake
@@ -32,6 +32,7 @@ set(piglit_glapi_inputs
${piglit_glapi_src_dir}/parse_glspec.py
${piglit_glapi_src_dir}/gl.tm
${piglit_glapi_src_dir}/gl.spec
+ ${piglit_glapi_src_dir}/enum.spec
${piglit_glapi_src_dir}/enumext.spec
)
diff --git a/glapi/parse_glspec.py b/glapi/parse_glspec.py
index 9be39f9..460512a 100644
--- a/glapi/parse_glspec.py
+++ b/glapi/parse_glspec.py
@@ -465,5 +465,7 @@ if __name__ == '__main__':
api.read_gl_spec(f)
with open(sys.argv[3]) as f:
api.read_enumext_spec(f)
- with open(sys.argv[4], 'w') as f:
+ with open(sys.argv[4]) as f:
+ api.read_enumext_spec(f)
+ with open(sys.argv[5], 'w') as f:
f.write(api.to_json())
diff --git a/tests/util/gen_dispatch.py b/tests/util/gen_dispatch.py
index 46e96fd..8aabf64 100644
--- a/tests/util/gen_dispatch.py
+++ b/tests/util/gen_dispatch.py
@@ -83,11 +83,11 @@
#
# - A #define for each extension, e.g.:
#
-# #define GL_ARB_vertex_buffer_object
+# #define GL_ARB_vertex_buffer_object 1
#
# - A #define for each known GL version, e.g.:
#
-# #define GL_VERSION_1_5
+# #define GL_VERSION_1_5 1
#
#
# The generated C file consists of the following:
@@ -389,24 +389,6 @@ class Api(object):
enums_by_value.sort()
return [item[1] for item in enums_by_value]
- # A list of all of the extension names declared in the API, as
- # Python strings, sorted alphabetically.
- @property
- def extensions(self):
- return sorted(
- [category_name
- for category_name, category in self.categories.items()
- if category.kind == 'extension'])
-
- # A list of all of the GL versions declared in the API, as
- # integers (e.g. 13 represents GL version 1.3).
- @property
- def gl_versions(self):
- return sorted(
- [category.gl_10x_version
- for category in self.categories.values()
- if category.kind == 'GL'])
-
# Generate a list of DispatchSet objects representing all sets of
# synonymous functions in the API. The resulting list is sorted
# by DispatchSet.stub_name.
@@ -630,17 +612,6 @@ def generate_code(api):
for name, value in api.compute_unique_enums():
h_contents.append('#define GL_{0} {1}\n'.format(name, value))
- # Emit extension #defines
- h_contents.append('\n')
- for ext in api.extensions:
- h_contents.append('#define {0}\n'.format(ext))
-
- # Emit GL version #defines
- h_contents.append('\n')
- for ver in api.gl_versions:
- h_contents.append('#define GL_VERSION_{0}_{1}\n'.format(
- ver // 10, ver % 10))
-
return ''.join(c_contents), ''.join(h_contents)
--
1.8.3.rc0
More information about the Piglit
mailing list