summaryrefslogtreecommitdiffstats
path: root/src/compiler/Makefile.nir.am
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2017-07-17 12:31:06 -0700
committerJason Ekstrand <[email protected]>2017-07-18 09:43:12 -0700
commit2dd4e2ece32f86d7973cf444c7dae06d4cb1e40e (patch)
tree58f171ee24149c3d85383bad37b624a8eec10b29 /src/compiler/Makefile.nir.am
parentde765ec9dc90c7e8325c6b101439fdebc87cf064 (diff)
spirv: Generate spirv_info.c
The old table based spirv_*_to_string functions would return NULL for any values "inside" the table that didn't have entries. The tables also needed to be updated by hand each time a new spirv.h was imported. Generate the file instead. v2: Make this script work more like src/mesa/main/format_fallback.py. Suggested by Jason. Remove SCons supports. Suggested by Jason and Emil. Put all the build work in Makefile.nir.am in lieu of adding a new Makefile.spirv.am. Suggested by Emil. Add support for Android builds based on code provided by Emil. Signed-off-by: Ian Romanick <[email protected]> Suggested-by: Jason Ekstrand <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/compiler/Makefile.nir.am')
-rw-r--r--src/compiler/Makefile.nir.am16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/compiler/Makefile.nir.am b/src/compiler/Makefile.nir.am
index 13f02a7fc29..1533ee536d3 100644
--- a/src/compiler/Makefile.nir.am
+++ b/src/compiler/Makefile.nir.am
@@ -29,6 +29,7 @@ nir_libnir_la_LIBADD = \
nir_libnir_la_SOURCES = \
$(NIR_FILES) \
$(SPIRV_FILES) \
+ $(SPIRV_GENERATED_FILES) \
$(NIR_GENERATED_FILES)
nir/nir_builder_opcodes.h: nir/nir_opcodes.py nir/nir_builder_opcodes_h.py
@@ -51,6 +52,10 @@ nir/nir_opt_algebraic.c: nir/nir_opt_algebraic.py nir/nir_algebraic.py
$(MKDIR_GEN)
$(PYTHON_GEN) $(srcdir)/nir/nir_opt_algebraic.py > $@ || ($(RM) $@; false)
+spirv/spirv_info.c: spirv/spirv_info_c.py spirv/spirv.core.grammar.json
+ $(MKDIR_GEN)
+ $(PYTHON_GEN) $(srcdir)/spirv/spirv_info_c.py $(srcdir)/spirv/spirv.core.grammar.json $@ || ($(RM) $@; false)
+
noinst_PROGRAMS += spirv2nir
spirv2nir_SOURCES = \
@@ -91,8 +96,13 @@ nir_tests_control_flow_tests_LDADD = \
TESTS += nir/tests/control_flow_tests
-BUILT_SOURCES += $(NIR_GENERATED_FILES)
-CLEANFILES += $(NIR_GENERATED_FILES)
+BUILT_SOURCES += \
+ $(NIR_GENERATED_FILES) \
+ $(SPIRV_GENERATED_FILES)
+
+CLEANFILES += \
+ $(NIR_GENERATED_FILES) \
+ $(SPIRV_GENERATED_FILES)
EXTRA_DIST += \
nir/nir_algebraic.py \
@@ -104,4 +114,6 @@ EXTRA_DIST += \
nir/nir_opt_algebraic.py \
nir/tests \
nir/README \
+ spirv/spirv_info_c.py \
+ spirv/spirv.core.grammar.json \
SConscript.nir