spirv: Fix building with SCons

The SCons build broke with commit ba975140d3 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 <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Neil Roberts 2018-03-30 09:12:00 -06:00 committed by Brian Paul
parent cdc34e2cea
commit 31d91f019b
10 changed files with 70 additions and 2 deletions

View File

@ -100,4 +100,5 @@ EXTRA_DIST += \
nir/nir_opt_algebraic.py \
nir/tests \
nir/README \
SConscript.nir
SConscript.nir \
SConstript.spirv

View File

@ -27,3 +27,4 @@ Export('compiler')
SConscript('SConscript.glsl')
SConscript('SConscript.nir')
SConscript('SConscript.spirv')

View File

@ -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')

View File

@ -45,6 +45,7 @@ env.Prepend(LIBS = [
mesa,
glsl,
nir,
spirv,
gallium,
megadrivers_stub,
dri_common,

View File

@ -10,6 +10,7 @@ env.Prepend(LIBS = [
mesa,
glsl,
nir,
spirv,
gallium
])

View File

@ -18,7 +18,11 @@ env.Append(LIBS = [
'ws2_32',
])
env.Prepend(LIBS = [mesautil])
env.Prepend(LIBS = [
mesautil,
nir,
spirv
])
sources = ['libgl_gdi.c']
drivers = []

View File

@ -33,6 +33,7 @@ env.Prepend(LIBS = [
mesa,
glsl,
nir,
spirv,
gallium,
])

View File

@ -18,6 +18,7 @@ env.Prepend(LIBS = [
trace,
glsl,
nir,
spirv,
mesautil,
softpipe
])

View File

@ -15,6 +15,8 @@ env.Prepend(LIBS = [
glapi,
compiler,
mesa,
spirv,
nir,
glsl,
])

View File

@ -21,6 +21,8 @@ env.Prepend(LIBS = [
compiler,
glsl,
mesa,
spirv,
nir,
])
sources = [