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:
@@ -64,6 +64,7 @@ include Makefile.sources
|
|||||||
|
|
||||||
BUILT_SOURCES = \
|
BUILT_SOURCES = \
|
||||||
main/get_hash.h \
|
main/get_hash.h \
|
||||||
|
main/format_info.c \
|
||||||
$(BUILDDIR)main/git_sha1.h \
|
$(BUILDDIR)main/git_sha1.h \
|
||||||
$(BUILDDIR)program/program_parse.tab.c \
|
$(BUILDDIR)program/program_parse.tab.c \
|
||||||
$(BUILDDIR)program/lex.yy.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; \
|
-f $< > $@.tmp; \
|
||||||
mv $@.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)
|
noinst_LTLIBRARIES = $(ARCH_LIBS)
|
||||||
if NEED_LIBMESA
|
if NEED_LIBMESA
|
||||||
noinst_LTLIBRARIES += libmesa.la
|
noinst_LTLIBRARIES += libmesa.la
|
||||||
|
@@ -59,6 +59,13 @@ get_hash_header = env.CodeGenerate(
|
|||||||
command = python_cmd + ' $SCRIPT ' + ' -f $SOURCE > $TARGET'
|
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
|
# Assembly sources
|
||||||
#
|
#
|
||||||
|
1
src/mesa/main/.gitignore
vendored
1
src/mesa/main/.gitignore
vendored
@@ -8,3 +8,4 @@ git_sha1.h.tmp
|
|||||||
remap_helper.h
|
remap_helper.h
|
||||||
get_hash.h
|
get_hash.h
|
||||||
get_hash.h.tmp
|
get_hash.h.tmp
|
||||||
|
format_info.c
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user