summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2013-02-26 10:23:01 -0700
committerBrian Paul <brianp@vmware.com>2013-02-26 10:34:35 -0700
commit764be60caf5e2dfe95e772e6fd1af48c808633c8 (patch)
tree64909193a8c2328bb982ec45cfe01086351a9d4c
parent22c61a33a29bf3f26cc2dacad6eb8ea6ea6ff864 (diff)
mesa: generate glGet code for all APIs
No longer pass -a flag to get_hash_generate.py script to specify OpenGL, ES1, ES2, etc.
-rw-r--r--src/mesa/Makefile.am6
-rw-r--r--src/mesa/main/get_hash_generator.py26
2 files changed, 5 insertions, 27 deletions
diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am
index 41483dd63e..84fc3eb03e 100644
--- a/src/mesa/Makefile.am
+++ b/src/mesa/Makefile.am
@@ -59,14 +59,12 @@ CLEANFILES = \
git_sha1.h.tmp
GET_HASH_GEN = main/get_hash_generator.py
-GET_HASH_GEN_FLAGS := $(patsubst -DFEATURE_%=1,-a %, \
- $(patsubst -DFEATURE_%=0,,$(API_DEFINES)))
main/get_hash.h: $(GLAPI)/gl_and_es_API.xml main/get_hash_params.py \
$(GET_HASH_GEN) Makefile
$(AM_V_GEN)set -e; \
- $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/$(GET_HASH_GEN) \
- $(GET_HASH_GEN_FLAGS) -f $< > $@.tmp; \
+ $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/$(GET_HASH_GEN) \
+ -f $< > $@.tmp; \
mv $@.tmp $@;
noinst_LTLIBRARIES =
diff --git a/src/mesa/main/get_hash_generator.py b/src/mesa/main/get_hash_generator.py
index 04bf9ffe6c..96bc495879 100644
--- a/src/mesa/main/get_hash_generator.py
+++ b/src/mesa/main/get_hash_generator.py
@@ -179,54 +179,34 @@ def generate_hash_tables(enum_list, enabled_apis, param_descriptors):
return params, merge_tables(sorted_tables)
-def opt_to_apis(feature):
- _map = {"ES1": "GLES", "ES2": "GLES2", "GL": "GL"}
- if feature not in _map:
- return None
-
- apis = set([_map[feature]])
- if "GL" in apis:
- apis.add("GL_CORE")
- if "GLES2" in apis:
- apis.add("GLES3")
-
- return apis
def show_usage():
sys.stderr.write(
"""Usage: %s [OPTIONS]
-f <file> specify GL API XML file
- -a [GL|ES1|ES2] specify APIs to generate hash tables for
""" % (program))
exit(1)
if __name__ == '__main__':
try:
- (opts, args) = getopt.getopt(sys.argv[1:], "f:a:")
+ (opts, args) = getopt.getopt(sys.argv[1:], "f:")
except Exception,e:
show_usage()
if len(args) != 0:
show_usage()
- enabled_apis = set([])
api_desc_file = ""
for opt_name, opt_val in opts:
if opt_name == "-f":
api_desc_file = opt_val
- if opt_name == "-a":
- apis = opt_to_apis(opt_val.upper())
- if not apis:
- die("invalid API %s\n" % opt_val)
-
- enabled_apis |= apis
if not api_desc_file:
die("missing descriptor file (-f)\n")
- if len(enabled_apis) == 0:
- die("need at least a single enabled API\n")
+ # generate the code for all APIs
+ enabled_apis = set(["GLES", "GLES2", "GLES3", "GL", "GL_CORE"])
try:
api_desc = gl_XML.parse_GL_API(api_desc_file)