with_gallium_opencl = true
with_opencl_icd = _opencl == 'icd'
+ with_opencl_spirv = get_option('opencl-spirv')
+ if with_opencl_spirv
+ dep_spirv_tools = dependency('SPIRV-Tools', required : true, version : '>= 2018.0')
+ # LLVMSPIRVLib is available at https://github.com/KhronosGroup/SPIRV-LLVM-Translator
+ dep_llvmspirvlib = dependency('LLVMSPIRVLib', required : true, version : '>= 0.2.1')
+ else
+ dep_spirv_tools = null_dep
+ dep_llvmspirvlib = null_dep
+ endif
+
if host_machine.cpu_family().startswith('ppc') and cpp.compiles('''
#if !defined(__VEC__) || !defined(__ALTIVEC__)
#error "AltiVec not enabled"
endif
else
dep_clc = null_dep
+ dep_spirv_tools = null_dep
+ dep_llvmspirvlib = null_dep
with_gallium_opencl = false
with_opencl_icd = false
+ with_opencl_spirv = false
endif
gl_pkgconfig_c_flags = []
value : 'disabled',
description : 'build gallium "clover" OpenCL state tracker.',
)
+option(
+ 'opencl-spirv',
+ type : 'boolean',
+ value : false,
+ description : 'build gallium "clover" OpenCL state tracker with SPIR-V binary support.',
+)
option(
'd3d-drivers-path',
type : 'string',
# SOFTWARE.
clover_cpp_args = []
+clover_spirv_cpp_args = []
clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux]
if with_opencl_icd
clover_cpp_args += '-DHAVE_CLOVER_ICD'
endif
+if with_opencl_spirv
+ clover_spirv_cpp_args += '-DHAVE_CLOVER_SPIRV'
+endif
+
libclllvm = static_library(
'clllvm',
files(
),
include_directories : clover_incs,
cpp_args : [
- cpp_vis_args,
+ clover_spirv_cpp_args, cpp_vis_args,
'-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('includedir')),
'-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('libexecdir')),
'-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
'clover',
[clover_files, sha1_h],
include_directories : clover_incs,
- cpp_args : [clover_cpp_args, cpp_vis_args],
+ cpp_args : [clover_spirv_cpp_args, clover_cpp_args, cpp_vis_args],
link_with : [libclllvm],
override_options : clover_cpp_std,
)