Module: Mesa
Branch: master
Commit: 31d91f019b58ca362c05db1fd0c75fedd169cd7b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=31d91f019b58ca362c05db1fd0c75fedd169cd7b

Author: Neil Roberts <nrobe...@igalia.com>
Date:   Fri Mar 30 09:12:00 2018 -0600

spirv: Fix building with SCons

The SCons build broke with commit ba975140d3c9 because a SPIR-V
function is called from Mesa main. This adds a convenience library for
SPIR-V and adds it to everything that was including nir. It also adds
both nir and spirv to drivers/x11/SConscript.

Also add nir/spirv modules to osmesa and libgl-gdi targets. (Brian Paul)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105817
Reviewed-by: Brian Paul <bri...@vmware.com>
Tested-by: Brian Paul <bri...@vmware.com>

---

 src/compiler/Makefile.nir.am                  |  3 +-
 src/compiler/SConscript                       |  1 +
 src/compiler/SConscript.spirv                 | 54 +++++++++++++++++++++++++++
 src/gallium/targets/dri/SConscript            |  1 +
 src/gallium/targets/haiku-softpipe/SConscript |  1 +
 src/gallium/targets/libgl-gdi/SConscript      |  6 ++-
 src/gallium/targets/libgl-xlib/SConscript     |  1 +
 src/gallium/targets/osmesa/SConscript         |  1 +
 src/mesa/drivers/osmesa/SConscript            |  2 +
 src/mesa/drivers/x11/SConscript               |  2 +
 10 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/src/compiler/Makefile.nir.am b/src/compiler/Makefile.nir.am
index 32e4145b70..27dc129e57 100644
--- a/src/compiler/Makefile.nir.am
+++ b/src/compiler/Makefile.nir.am
@@ -100,4 +100,5 @@ EXTRA_DIST += \
        nir/nir_opt_algebraic.py                        \
        nir/tests \
        nir/README \
-       SConscript.nir
+       SConscript.nir \
+       SConstript.spirv
diff --git a/src/compiler/SConscript b/src/compiler/SConscript
index 44509a9a95..0a0c073742 100644
--- a/src/compiler/SConscript
+++ b/src/compiler/SConscript
@@ -27,3 +27,4 @@ Export('compiler')
 
 SConscript('SConscript.glsl')
 SConscript('SConscript.nir')
+SConscript('SConscript.spirv')
diff --git a/src/compiler/SConscript.spirv b/src/compiler/SConscript.spirv
new file mode 100644
index 0000000000..49410881d0
--- /dev/null
+++ b/src/compiler/SConscript.spirv
@@ -0,0 +1,54 @@
+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',
+    '#src/compiler/spirv',
+])
+
+# Make generated headers reachable from the include path.
+env.Prepend(CPPPATH = [Dir('.').abspath, Dir('nir').abspath])
+env.Prepend(CPPPATH = [Dir('.').abspath, Dir('spirv').abspath])
+
+# spirv generated sources
+
+env.CodeGenerate(
+    target = 'spirv/spirv_info.c',
+    script = 'spirv/spirv_info_c.py',
+    source = ['spirv/spirv.core.grammar.json'],
+    command = python_cmd + ' $SCRIPT $SOURCE $TARGET'
+)
+
+env.CodeGenerate(
+    target = 'spirv/vtn_gather_types.c',
+    script = 'spirv/vtn_gather_types_c.py',
+    source = ['spirv/spirv.core.grammar.json'],
+    command = python_cmd + ' $SCRIPT $SOURCE $TARGET'
+)
+
+# parse Makefile.sources
+source_lists = env.ParseSourceList('Makefile.sources')
+
+spirv_sources = source_lists['SPIRV_FILES']
+spirv_sources += source_lists['SPIRV_GENERATED_FILES']
+
+spirv = env.ConvenienceLibrary(
+    target = 'spirv',
+    source = spirv_sources,
+)
+
+env.Alias('spirv', spirv)
+Export('spirv')
diff --git a/src/gallium/targets/dri/SConscript 
b/src/gallium/targets/dri/SConscript
index f5c2818d04..ff6ce3bf4e 100644
--- a/src/gallium/targets/dri/SConscript
+++ b/src/gallium/targets/dri/SConscript
@@ -45,6 +45,7 @@ env.Prepend(LIBS = [
     mesa,
     glsl,
     nir,
+    spirv,
     gallium,
     megadrivers_stub,
     dri_common,
diff --git a/src/gallium/targets/haiku-softpipe/SConscript 
b/src/gallium/targets/haiku-softpipe/SConscript
index f80c167d83..89792fba13 100644
--- a/src/gallium/targets/haiku-softpipe/SConscript
+++ b/src/gallium/targets/haiku-softpipe/SConscript
@@ -10,6 +10,7 @@ env.Prepend(LIBS = [
     mesa,
     glsl,
     nir,
+    spirv,
     gallium
 ])
 
diff --git a/src/gallium/targets/libgl-gdi/SConscript 
b/src/gallium/targets/libgl-gdi/SConscript
index d3251caec5..b5ba0fabcd 100644
--- a/src/gallium/targets/libgl-gdi/SConscript
+++ b/src/gallium/targets/libgl-gdi/SConscript
@@ -18,7 +18,11 @@ env.Append(LIBS = [
     'ws2_32',
 ])
 
-env.Prepend(LIBS = [mesautil])
+env.Prepend(LIBS = [
+    mesautil,
+    nir,
+    spirv
+])
 
 sources = ['libgl_gdi.c']
 drivers = []
diff --git a/src/gallium/targets/libgl-xlib/SConscript 
b/src/gallium/targets/libgl-xlib/SConscript
index a81ac79325..b94ef350b1 100644
--- a/src/gallium/targets/libgl-xlib/SConscript
+++ b/src/gallium/targets/libgl-xlib/SConscript
@@ -33,6 +33,7 @@ env.Prepend(LIBS = [
     mesa,
     glsl,
     nir,
+    spirv,
     gallium,
 ])
 
diff --git a/src/gallium/targets/osmesa/SConscript 
b/src/gallium/targets/osmesa/SConscript
index 7be1b48c0b..ccf7d5170c 100644
--- a/src/gallium/targets/osmesa/SConscript
+++ b/src/gallium/targets/osmesa/SConscript
@@ -18,6 +18,7 @@ env.Prepend(LIBS = [
     trace,
     glsl,
     nir,
+    spirv,
     mesautil,
     softpipe
 ])
diff --git a/src/mesa/drivers/osmesa/SConscript 
b/src/mesa/drivers/osmesa/SConscript
index 9391dc3282..064f3da5da 100644
--- a/src/mesa/drivers/osmesa/SConscript
+++ b/src/mesa/drivers/osmesa/SConscript
@@ -15,6 +15,8 @@ env.Prepend(LIBS = [
     glapi,
     compiler,
     mesa,
+    spirv,
+    nir,
     glsl,
 ])
 
diff --git a/src/mesa/drivers/x11/SConscript b/src/mesa/drivers/x11/SConscript
index 59c8df4b3c..b097dcc590 100644
--- a/src/mesa/drivers/x11/SConscript
+++ b/src/mesa/drivers/x11/SConscript
@@ -21,6 +21,8 @@ env.Prepend(LIBS = [
     compiler,
     glsl,
     mesa,
+    spirv,
+    nir,
 ])
 
 sources = [

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to