meson: Add precomp-compiler and install-precomp-compiler options
As Asahi, Intel and soon Panfrost requires an offline compiler for their respective internal shaders, this commit adds generic new options to workaround meson current limitations around cross-compillation. Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32719>
This commit is contained in:

committed by
Marge Bot

parent
13fe5a597b
commit
5ddeea9a62
11
meson.build
11
meson.build
@@ -303,9 +303,10 @@ with_any_broadcom = [
|
|||||||
with_broadcom_vk,
|
with_broadcom_vk,
|
||||||
].contains(true)
|
].contains(true)
|
||||||
|
|
||||||
if get_option('intel-clc') != 'system'
|
if get_option('intel-clc') != 'system' and get_option('precomp-compiler') != 'system'
|
||||||
# Require intel-clc with Anv & Iris (for internal shaders)
|
# Require intel-clc with Anv & Iris (for internal shaders)
|
||||||
with_intel_clc = get_option('intel-clc') == 'enabled' or \
|
with_intel_clc = get_option('intel-clc') == 'enabled' or \
|
||||||
|
get_option('precomp-compiler') == 'enabled' or \
|
||||||
with_intel_vk or with_gallium_iris
|
with_intel_vk or with_gallium_iris
|
||||||
else
|
else
|
||||||
with_intel_clc = false
|
with_intel_clc = false
|
||||||
@@ -811,7 +812,13 @@ if with_gallium_rusticl or with_nouveau_vk or with_tools.contains('etnaviv')
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
with_clc = get_option('mesa-clc') != 'auto' or with_microsoft_clc or with_intel_clc or with_gallium_asahi or with_asahi_vk or with_gallium_rusticl
|
if get_option('precomp-compiler') != 'system'
|
||||||
|
with_drivers_clc = get_option('precomp-compiler') == 'enabled'
|
||||||
|
else
|
||||||
|
with_drivers_clc = false
|
||||||
|
endif
|
||||||
|
|
||||||
|
with_clc = get_option('mesa-clc') != 'auto' or with_microsoft_clc or with_intel_clc or with_drivers_clc or with_gallium_asahi or with_asahi_vk or with_gallium_rusticl
|
||||||
|
|
||||||
dep_clc = null_dep
|
dep_clc = null_dep
|
||||||
if with_gallium_clover or with_clc
|
if with_gallium_clover or with_clc
|
||||||
|
@@ -760,3 +760,20 @@ option(
|
|||||||
value : false,
|
value : false,
|
||||||
description : 'Install the mesa-clc compiler (if needed for cross builds).'
|
description : 'Install the mesa-clc compiler (if needed for cross builds).'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
option(
|
||||||
|
'precomp-compiler',
|
||||||
|
type : 'combo',
|
||||||
|
value : 'auto',
|
||||||
|
choices : [
|
||||||
|
'enabled', 'system', 'auto'
|
||||||
|
],
|
||||||
|
description : 'Build drivers internal shader compilers or use a system version'
|
||||||
|
)
|
||||||
|
|
||||||
|
option(
|
||||||
|
'install-precomp-compiler',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Install the drivers internal shader compilers (if needed for cross builds).'
|
||||||
|
)
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
# Copyright 2017 Intel Corporation
|
# Copyright 2017 Intel Corporation
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
if get_option('precomp-compiler') == 'system'
|
||||||
|
prog_asahi_clc = find_program('asahi_clc', native : true)
|
||||||
|
else
|
||||||
prog_asahi_clc = executable(
|
prog_asahi_clc = executable(
|
||||||
'asahi_clc',
|
'asahi_clc',
|
||||||
['asahi_clc.c'],
|
['asahi_clc.c'],
|
||||||
@@ -13,4 +16,6 @@ prog_asahi_clc = executable(
|
|||||||
# Most commonly this happens when doing a cross compile from an x86_64 build
|
# Most commonly this happens when doing a cross compile from an x86_64 build
|
||||||
# machine to an x86 host
|
# machine to an x86 host
|
||||||
native : not meson.can_run_host_binaries(),
|
native : not meson.can_run_host_binaries(),
|
||||||
|
install : get_option('install-precomp-compiler'),
|
||||||
)
|
)
|
||||||
|
endif
|
||||||
|
@@ -161,7 +161,7 @@ idep_intel_compiler_brw = declare_dependency(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# For now this tool is only going to be used by Anv
|
# For now this tool is only going to be used by Anv
|
||||||
if get_option('intel-clc') == 'system'
|
if get_option('intel-clc') == 'system' or get_option('precomp-compiler') == 'system'
|
||||||
prog_intel_clc = find_program('intel_clc', native : true)
|
prog_intel_clc = find_program('intel_clc', native : true)
|
||||||
dep_prog_intel_clc = []
|
dep_prog_intel_clc = []
|
||||||
elif with_intel_clc
|
elif with_intel_clc
|
||||||
@@ -185,7 +185,7 @@ elif with_intel_clc
|
|||||||
# Most commonly this happens when doing a cross compile from an x86_64 build
|
# Most commonly this happens when doing a cross compile from an x86_64 build
|
||||||
# machine to an x86 host
|
# machine to an x86 host
|
||||||
native : not meson.can_run_host_binaries(),
|
native : not meson.can_run_host_binaries(),
|
||||||
install : get_option('install-intel-clc'),
|
install : get_option('install-intel-clc') or get_option('install-precomp-compiler'),
|
||||||
)
|
)
|
||||||
dep_prog_intel_clc = [prog_intel_clc]
|
dep_prog_intel_clc = [prog_intel_clc]
|
||||||
endif
|
endif
|
||||||
|
Reference in New Issue
Block a user