meson/vulkan/util: allow venus to drop compiler deps
Files to compile: 451 => 232 Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26783>
This commit is contained in:
14
meson.build
14
meson.build
@@ -251,6 +251,20 @@ with_microsoft_vk = _vulkan_drivers.contains('microsoft-experimental')
|
||||
with_nouveau_vk = _vulkan_drivers.contains('nouveau-experimental')
|
||||
with_any_vk = _vulkan_drivers.length() != 0
|
||||
|
||||
with_vk_compiler = [
|
||||
with_intel_vk,
|
||||
with_intel_hasvk,
|
||||
with_amd_vk,
|
||||
with_freedreno_vk,
|
||||
with_panfrost_vk,
|
||||
with_swrast_vk,
|
||||
with_broadcom_vk,
|
||||
with_imagination_vk,
|
||||
with_microsoft_vk,
|
||||
with_nouveau_vk,
|
||||
].contains(true)
|
||||
pre_args += '-DUSE_VK_COMPILER=@0@'.format(with_vk_compiler ? '1' : '0')
|
||||
|
||||
freedreno_kmds = get_option('freedreno-kmds')
|
||||
if freedreno_kmds.length() != 0 and freedreno_kmds != [ 'msm' ] and with_freedreno_vk
|
||||
if freedreno_kmds.contains('msm')
|
||||
|
@@ -121,11 +121,14 @@ vulkan_runtime_files = files(
|
||||
vulkan_runtime_deps = [
|
||||
vulkan_wsi_deps,
|
||||
idep_mesautil,
|
||||
idep_nir,
|
||||
idep_vtn,
|
||||
idep_nir_headers,
|
||||
idep_vulkan_util,
|
||||
]
|
||||
|
||||
if with_vk_compiler
|
||||
vulkan_runtime_deps += [idep_nir, idep_vtn]
|
||||
endif
|
||||
|
||||
if dep_libdrm.found()
|
||||
vulkan_runtime_files += files('vk_drm_syncobj.c', 'vk_drm_syncobj.h')
|
||||
vulkan_runtime_deps += dep_libdrm
|
||||
|
@@ -34,8 +34,6 @@
|
||||
#include "vk_debug_utils.h"
|
||||
#include "vk_physical_device.h"
|
||||
|
||||
#include "compiler/glsl_types.h"
|
||||
|
||||
#define VERSION_IS_1_0(version) \
|
||||
(VK_API_VERSION_MAJOR(version) == 1 && VK_API_VERSION_MINOR(version) == 0)
|
||||
|
||||
@@ -201,7 +199,7 @@ vk_instance_init(struct vk_instance *instance,
|
||||
instance->trace_frame = (uint32_t)debug_get_num_option("MESA_VK_TRACE_FRAME", 0xFFFFFFFF);
|
||||
instance->trace_trigger_file = getenv("MESA_VK_TRACE_TRIGGER");
|
||||
|
||||
glsl_type_singleton_init_or_ref();
|
||||
vk_compiler_cache_init();
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
@@ -221,7 +219,7 @@ vk_instance_finish(struct vk_instance *instance)
|
||||
{
|
||||
destroy_physical_devices(instance);
|
||||
|
||||
glsl_type_singleton_decref();
|
||||
vk_compiler_cache_finish();
|
||||
if (unlikely(!list_is_empty(&instance->debug_utils.callbacks))) {
|
||||
list_for_each_entry_safe(struct vk_debug_utils_messenger, messenger,
|
||||
&instance->debug_utils.callbacks, link) {
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "vk_util.h"
|
||||
#include "util/u_debug.h"
|
||||
|
||||
#include "compiler/glsl_types.h"
|
||||
#include "compiler/spirv/nir_spirv.h"
|
||||
|
||||
uint32_t vk_get_driver_version(void)
|
||||
@@ -141,3 +142,19 @@ vk_spec_info_to_nir_spirv(const VkSpecializationInfo *spec_info,
|
||||
*out_num_spec_entries = num_spec_entries;
|
||||
return spec_entries;
|
||||
}
|
||||
|
||||
void
|
||||
vk_compiler_cache_init(void)
|
||||
{
|
||||
#if USE_VK_COMPILER
|
||||
glsl_type_singleton_init_or_ref();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
vk_compiler_cache_finish(void)
|
||||
{
|
||||
#if USE_VK_COMPILER
|
||||
glsl_type_singleton_decref();
|
||||
#endif
|
||||
}
|
||||
|
@@ -316,6 +316,12 @@ struct vk_pipeline_cache_header {
|
||||
memcpy((dest), (src), (count) * sizeof(*(src))); \
|
||||
} while (0)
|
||||
|
||||
void
|
||||
vk_compiler_cache_init(void);
|
||||
|
||||
void
|
||||
vk_compiler_cache_finish(void);
|
||||
|
||||
static inline gl_shader_stage
|
||||
vk_to_mesa_shader_stage(VkShaderStageFlagBits vk_stage)
|
||||
{
|
||||
|
Reference in New Issue
Block a user