mesa/formats: Autogenerate the format_info structure from a CSV file

Instead of a having all of the format metadata in a gigantic hard-to-edit
array of type struct format_info, we now have a human-readable CSV file.
The CSV file also contains more format information than the format_info
struct contained so we can potentially make format_info more detailed later.

The python to generate the format information was added the previous
commit.  This commit turns it on in both automake and scons builds.

v2: Split into two commits and stuff to generate format_info.c from scons

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Jason Ekstrand
2014-06-20 15:52:10 -07:00
parent 3420565310
commit 12610ffcf7
4 changed files with 19 additions and 1738 deletions

View File

@@ -64,6 +64,7 @@ include Makefile.sources
BUILT_SOURCES = \
main/get_hash.h \
main/format_info.c \
$(BUILDDIR)main/git_sha1.h \
$(BUILDDIR)program/program_parse.tab.c \
$(BUILDDIR)program/lex.yy.c
@@ -81,6 +82,15 @@ main/get_hash.h: $(GLAPI)/gl_and_es_API.xml main/get_hash_params.py \
-f $< > $@.tmp; \
mv $@.tmp $@;
main/format_info.c: main/formats.csv \
main/format_parser.py main/format_info.py
$(AM_V_GEN)set -e; \
$(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/main/format_info.py \
$< > $@.tmp; \
mv $@.tmp $@;
main/formats.c: main/format_info.c
noinst_LTLIBRARIES = $(ARCH_LIBS)
if NEED_LIBMESA
noinst_LTLIBRARIES += libmesa.la

View File

@@ -59,6 +59,13 @@ get_hash_header = env.CodeGenerate(
command = python_cmd + ' $SCRIPT ' + ' -f $SOURCE > $TARGET'
)
format_info = env.CodeGenerate(
target = 'main/format_info.c',
script = 'main/format_info.py',
source = 'main/formats.csv',
command = python_cmd + ' $SCRIPT ' + ' $SOURCE > $TARGET'
)
#
# Assembly sources
#

View File

@@ -8,3 +8,4 @@ git_sha1.h.tmp
remap_helper.h
get_hash.h
get_hash.h.tmp
format_info.c

File diff suppressed because it is too large Load Diff