From d8d808db279e8edba441c3416c87324a87a3bff5 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 17 Jul 2017 18:39:17 +0100 Subject: [PATCH] fixup! spirv: Generate spirv_info.c * Fold the <10 lines for automake into the NIR file, we already do SPIRV in there. * Drop the Spirv bits from SCons - not needed. * And quick hack of an Android build - untested. --- src/compiler/Android.nir.gen.mk | 7 +++++++ src/compiler/Makefile.am | 2 -- src/compiler/Makefile.nir.am | 11 +++++++++++ src/compiler/Makefile.spirv.am | 31 ------------------------------- src/compiler/SConscript | 1 - src/compiler/SConscript.spirv | 32 -------------------------------- 6 files changed, 18 insertions(+), 66 deletions(-) delete mode 100644 src/compiler/Makefile.spirv.am delete mode 100644 src/compiler/SConscript.spirv diff --git a/src/compiler/Android.nir.gen.mk b/src/compiler/Android.nir.gen.mk index 908875d7eb5..5af75e79820 100644 --- a/src/compiler/Android.nir.gen.mk +++ b/src/compiler/Android.nir.gen.mk @@ -94,3 +94,10 @@ nir_opt_algebraic_deps := \ $(intermediates)/nir/nir_opt_algebraic.c: $(nir_opt_algebraic_deps) @mkdir -p $(dir $@) $(hide) $(MESA_PYTHON2) $(nir_opt_algebraic_gen) $< > $@ + +LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \ + $(SPIRV_GENERATED_FILES)) + +$(intermediates)/spirv/spirv_info.c: spirv/spirv_info_c.py spirv/spirv.core.grammar.json + @mkdir -p $(dir $@) + $(hide) $(MESA_PYTHON2) spirv/spirv_info_c.py > $@ || ($(RM) $@; false) diff --git a/src/compiler/Makefile.am b/src/compiler/Makefile.am index b8f66977644..4c83365094b 100644 --- a/src/compiler/Makefile.am +++ b/src/compiler/Makefile.am @@ -63,5 +63,3 @@ PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS) include Makefile.glsl.am include Makefile.nir.am - -include Makefile.spirv.am diff --git a/src/compiler/Makefile.nir.am b/src/compiler/Makefile.nir.am index d10f1739627..565088ecd95 100644 --- a/src/compiler/Makefile.nir.am +++ b/src/compiler/Makefile.nir.am @@ -52,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 > $@ || ($(RM) $@; false) + noinst_PROGRAMS += spirv2nir spirv2nir_SOURCES = \ @@ -95,6 +99,9 @@ TESTS += nir/tests/control_flow_tests BUILT_SOURCES += $(NIR_GENERATED_FILES) CLEANFILES += $(NIR_GENERATED_FILES) +BUILT_SOURCES += $(SPIRV_GENERATED_FILES) +CLEANFILES += $(SPIRV_GENERATED_FILES) + EXTRA_DIST += \ nir/nir_algebraic.py \ nir/nir_builder_opcodes_h.py \ @@ -106,3 +113,7 @@ EXTRA_DIST += \ nir/tests \ nir/README \ SConscript.nir + +EXTRA_DIST += \ + spirv/spirv_info_c.py \ + spirv/spirv.core.grammar.json diff --git a/src/compiler/Makefile.spirv.am b/src/compiler/Makefile.spirv.am deleted file mode 100644 index 6d5dfc00e45..00000000000 --- a/src/compiler/Makefile.spirv.am +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (C) 2017 Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -spirv/spirv_info.c: spirv/spirv_info_c.py spirv/spirv.core.grammar.json - $(MKDIR_GEN) - $(PYTHON_GEN) $(srcdir)/spirv/spirv_info_c.py > $@ || ($(RM) $@; false) - -BUILT_SOURCES += $(SPIRV_GENERATED_FILES) -CLEANFILES += $(SPIRV_GENERATED_FILES) - -EXTRA_DIST += \ - spirv/spirv_info_c.py \ - spirv/spirv.core.grammar.json diff --git a/src/compiler/SConscript b/src/compiler/SConscript index 2797abea074..44509a9a95b 100644 --- a/src/compiler/SConscript +++ b/src/compiler/SConscript @@ -26,5 +26,4 @@ compiler = env.ConvenienceLibrary( Export('compiler') SConscript('SConscript.glsl') -SConscript('SConscript.spirv') SConscript('SConscript.nir') diff --git a/src/compiler/SConscript.spirv b/src/compiler/SConscript.spirv deleted file mode 100644 index 8a90c2f2af0..00000000000 --- a/src/compiler/SConscript.spirv +++ /dev/null @@ -1,32 +0,0 @@ -import common - -Import('*') - -from sys import executable as python_cmd - -env = env.Clone() - -env.MSVC2013Compat() - -env.Prepend(CPPPATH = [ - '#include', - '#src', - '#src/mapi', - '#src/mesa', - '#src/gallium/include', - '#src/gallium/auxiliary', - '#src/compiler/nir', -]) - -# Make generated headers reachable from the include path. -env.Prepend(CPPPATH = [Dir('.').abspath, Dir('glsl').abspath]) -env.Prepend(CPPPATH = [Dir('.').abspath, Dir('nir').abspath]) - -# SPIR-V generated sources - -spirv_info_c = env.CodeGenerate( - target = 'spirv/spirv_info.c', - script = 'spirv/spirv_info_c.py', - source = [], - command = python_cmd + ' $SCRIPT > $TARGET' -)