From a367cd49314a993d09168e790d3090a2303a48d9 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Mon, 5 Feb 2024 06:13:19 +0800 Subject: [PATCH] Revert "meson/vulkan/util: allow venus to drop compiler deps" This reverts commit 3923d43908fa3ac2c8535e33277229038333fe8f. Signed-off-by: Yonggang Luo Reviewed-by: Gurchetan Singh Reviewed-by: Yiwei Zhang Part-of: --- meson.build | 14 -------------- src/vulkan/runtime/meson.build | 7 ++----- src/vulkan/runtime/vk_instance.c | 6 ++++-- src/vulkan/util/vk_util.c | 17 ----------------- src/vulkan/util/vk_util.h | 6 ------ 5 files changed, 6 insertions(+), 44 deletions(-) diff --git a/meson.build b/meson.build index 88a8d28ec0e..25e92ea5f95 100644 --- a/meson.build +++ b/meson.build @@ -260,20 +260,6 @@ if with_any_vk and host_machine.system() == 'windows' and meson.version().versio error('Vulkan drivers on Windows require meson 1.3 or newer') endif -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') diff --git a/src/vulkan/runtime/meson.build b/src/vulkan/runtime/meson.build index 29b17f7737f..545beb49ea0 100644 --- a/src/vulkan/runtime/meson.build +++ b/src/vulkan/runtime/meson.build @@ -123,14 +123,11 @@ vulkan_runtime_files = files( vulkan_runtime_deps = [ vulkan_wsi_deps, idep_mesautil, - idep_nir_headers, + idep_nir, + idep_vtn, 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 diff --git a/src/vulkan/runtime/vk_instance.c b/src/vulkan/runtime/vk_instance.c index 4ed52d3ac44..df06e1416d6 100644 --- a/src/vulkan/runtime/vk_instance.c +++ b/src/vulkan/runtime/vk_instance.c @@ -34,6 +34,8 @@ #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) @@ -199,7 +201,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 = secure_getenv("MESA_VK_TRACE_TRIGGER"); - vk_compiler_cache_init(); + glsl_type_singleton_init_or_ref(); return VK_SUCCESS; } @@ -219,7 +221,7 @@ vk_instance_finish(struct vk_instance *instance) { destroy_physical_devices(instance); - vk_compiler_cache_finish(); + glsl_type_singleton_decref(); 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) { diff --git a/src/vulkan/util/vk_util.c b/src/vulkan/util/vk_util.c index afd009e26d5..841212034ec 100644 --- a/src/vulkan/util/vk_util.c +++ b/src/vulkan/util/vk_util.c @@ -29,7 +29,6 @@ #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) @@ -142,19 +141,3 @@ 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 -} diff --git a/src/vulkan/util/vk_util.h b/src/vulkan/util/vk_util.h index e1aef150c72..85807f410fa 100644 --- a/src/vulkan/util/vk_util.h +++ b/src/vulkan/util/vk_util.h @@ -316,12 +316,6 @@ 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) {