meson: don't pass vk wsi args where they don't belong

Only code that cares about Vulkan WSI should get the corresponding
arguments passed. Otherwise, the Vulkan headers might end up including
other headers that we don't have the correct dependencies passed for.
So let's give those a dedicated variable, and only pass that where it's
actually needed.

Fixes: b39958a3a1 ("anv,nir: Move the ANV YCbCr lowering pass to common code")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8193
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21185>
This commit is contained in:
Erik Faye-Lund
2023-02-08 09:34:34 +01:00
committed by Marge Bot
parent 7ea85871fe
commit 29ffc79410
18 changed files with 33 additions and 27 deletions
+9 -19
View File
@@ -362,38 +362,28 @@ with_xlib_lease = get_option('xlib-lease') \
.require(with_platform_x11 and system_has_kms_drm, error_message : 'xlib-lease requires X11 and KMS/DRM support') \
.allowed()
vk_wsi_args = []
if with_platform_wayland
c_args += '-DVK_USE_PLATFORM_WAYLAND_KHR'
#add this once aco and other places can build with it
#cpp_args += '-DVK_USE_PLATFORM_WAYLAND_KHR'
vk_wsi_args += '-DVK_USE_PLATFORM_WAYLAND_KHR'
endif
if with_platform_x11 and host_machine.system() != 'darwin'
c_args += ['-DVK_USE_PLATFORM_XCB_KHR', '-DVK_USE_PLATFORM_XLIB_KHR']
#add this once aco and other places can build with it
#cpp_args += ['-DVK_USE_PLATFORM_XCB_KHR', '-DVK_USE_PLATFORM_XLIB_KHR']
vk_wsi_args += ['-DVK_USE_PLATFORM_XCB_KHR', '-DVK_USE_PLATFORM_XLIB_KHR']
endif
if with_platform_windows
c_args += '-DVK_USE_PLATFORM_WIN32_KHR'
cpp_args += '-DVK_USE_PLATFORM_WIN32_KHR'
vk_wsi_args += '-DVK_USE_PLATFORM_WIN32_KHR'
endif
if with_platform_android
c_args += '-DVK_USE_PLATFORM_ANDROID_KHR'
cpp_args += '-DVK_USE_PLATFORM_ANDROID_KHR'
vk_wsi_args += '-DVK_USE_PLATFORM_ANDROID_KHR'
endif
if with_xlib_lease
c_args += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
#add this once aco and other places can build with it
#cpp_args += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
vk_wsi_args += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
endif
if system_has_kms_drm and not with_platform_android
c_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
cpp_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
vk_wsi_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
endif
if host_machine.system() == 'darwin'
c_args += '-DVK_USE_PLATFORM_MACOS_MVK'
cpp_args += '-DVK_USE_PLATFORM_MACOS_MVK'
c_args += '-DVK_USE_PLATFORM_METAL_EXT'
cpp_args += '-DVK_USE_PLATFORM_METAL_EXT'
vk_wsi_args += ['-DVK_USE_PLATFORM_MACOS_MVK', '-DVK_USE_PLATFORM_METAL_EXT']
endif
with_egl = get_option('egl') \
+1 -1
View File
@@ -196,7 +196,7 @@ libvulkan_radeon = shared_library(
idep_vulkan_runtime, idep_amdgfxregs_h, idep_xmlconfig,
idep_vulkan_common_entrypoints_h, idep_vulkan_wsi_entrypoints_h
],
c_args : [no_override_init_args, radv_flags, c_msvc_compat_args],
c_args : [no_override_init_args, vk_wsi_args, radv_flags, c_msvc_compat_args],
cpp_args : [radv_flags, cpp_msvc_compat_args],
link_args : [
ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections, libvulkan_radeon_ld_args,
+4
View File
@@ -106,6 +106,10 @@ if with_dri2
'drivers/dri2/platform_device.c',
'drivers/dri2/platform_surfaceless.c',
)
c_args_for_egl += vk_wsi_args
cpp_args_for_egl += vk_wsi_args
if with_platform_x11
files_egl += files('drivers/dri2/platform_x11.c')
if with_dri3
+1 -1
View File
@@ -127,7 +127,7 @@ libvulkan_freedreno = shared_library(
idep_vulkan_wsi,
idep_mesautil,
],
c_args : [no_override_init_args, tu_flags],
c_args : [no_override_init_args, tu_flags, vk_wsi_args],
gnu_symbol_visibility : 'hidden',
link_args : [ld_args_bsymbolic, ld_args_gc_sections, ld_args_build_id],
install : true,
+1 -1
View File
@@ -100,7 +100,7 @@ libzink = static_library(
idep_nir_headers, idep_mesautil, idep_vulkan_util_headers,
idep_vulkan_wsi_headers, idep_vulkan_util, dep_libdrm
],
c_args: zink_c_args,
c_args: [zink_c_args, vk_wsi_args],
)
driver_zink = declare_dependency(
+1
View File
@@ -51,6 +51,7 @@ if with_gallium_zink and not with_platform_android
libdri_c_args += '-DKOPPER_LIB_NAMES="libEGL and libGLX"'
endif
files_libdri += files('kopper.c')
libdri_c_args += vk_wsi_args
endif
if with_gallium_softpipe
+1 -1
View File
@@ -42,7 +42,7 @@ endif
liblavapipe_st = static_library(
'lavapipe_st',
[liblvp_files, lvp_entrypoints, sha1_h],
c_args : [ c_msvc_compat_args, lvp_flags ],
c_args : [ c_msvc_compat_args, lvp_flags, vk_wsi_args],
gnu_symbol_visibility : 'hidden',
include_directories : [ inc_include, inc_src, inc_util, inc_gallium, inc_compiler, inc_gallium_aux ],
dependencies : [ dep_llvm, idep_nir, idep_mesautil, idep_vulkan_util, idep_vulkan_wsi,
+4
View File
@@ -25,6 +25,10 @@ if not with_shared_glapi
_c_args_wgl += '-D_GLAPI_NO_EXPORTS'
endif
if with_gallium_zink
_c_args_wgl += vk_wsi_args
endif
files_libwgl = files(
'stw_context.c',
'stw_device.c',
+1
View File
@@ -128,6 +128,7 @@ libglx = static_library(
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_glapi, inc_loader],
c_args : [
'-DGL_LIB_NAME="lib@0@.so.@1@"'.format(gl_lib_name, gl_lib_version.split('.')[0]),
vk_wsi_args
],
gnu_symbol_visibility : 'hidden',
link_with : [
+1
View File
@@ -83,6 +83,7 @@ pvr_deps = [
pvr_flags = [
no_override_init_args,
vk_wsi_args,
]
if with_imagination_srv
+1
View File
@@ -25,6 +25,7 @@ inc_anv = include_directories('.')
anv_flags = [
no_override_init_args,
c_sse2_args,
vk_wsi_args,
]
anv_cpp_flags = []
+1
View File
@@ -139,6 +139,7 @@ anv_deps = [
anv_flags = [
no_override_init_args,
c_sse2_args,
vk_wsi_args,
]
anv_cpp_flags = []
+1 -1
View File
@@ -85,7 +85,7 @@ libvulkan_dzn = shared_library(
inc_compiler, inc_util
],
dependencies : [dzn_deps, idep_vulkan_wsi, idep_xmlconfig],
c_args : dzn_flags,
c_args : [dzn_flags, vk_wsi_args],
cpp_args : dzn_cpp_flags,
gnu_symbol_visibility : 'hidden',
link_args : [ld_args_bsymbolic, ld_args_gc_sections],
+1 -1
View File
@@ -134,7 +134,7 @@ libvulkan_panfrost = shared_library(
idep_vulkan_wsi,
idep_mesautil,
],
c_args : [no_override_init_args, panvk_flags],
c_args : [no_override_init_args, panvk_flags, vk_wsi_args],
link_args : [ld_args_bsymbolic, ld_args_gc_sections],
install : true,
)
+1
View File
@@ -82,6 +82,7 @@ vn_deps = [
vn_flags = [
no_override_init_args,
vk_wsi_args,
]
vn_libs = []
+1 -1
View File
@@ -39,7 +39,7 @@ endif
vklayer_mesa_device_select = shared_library(
'VkLayer_MESA_device_select',
vklayer_files,
c_args : [no_override_init_args, vklayer_flags],
c_args : [no_override_init_args, vklayer_flags, vk_wsi_args],
gnu_symbol_visibility : 'hidden',
dependencies : [
idep_vulkan_util, idep_vulkan_wsi_headers, idep_mesautil, vklayer_deps,
+1 -1
View File
@@ -189,7 +189,7 @@ libvulkan_runtime = static_library(
dependencies : vulkan_runtime_deps,
# For glsl_type_singleton
link_with : libcompiler,
c_args : [c_msvc_compat_args],
c_args : [c_msvc_compat_args, vk_wsi_args],
gnu_symbol_visibility : 'hidden',
build_by_default : false,
)
+2
View File
@@ -60,6 +60,8 @@ wsi_entrypoints = custom_target(
libvulkan_wsi = static_library(
'vulkan_wsi',
[files_vulkan_wsi, wsi_entrypoints],
c_args: [vk_wsi_args],
cpp_args: [vk_wsi_args],
include_directories : [inc_include, inc_src, inc_gallium],
dependencies : [
vulkan_wsi_deps, dep_libdrm, dep_libudev, idep_vulkan_util_headers,