mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
vulkan: Move all the common object code to runtime/
Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
This commit is contained in:
parent
4af0c038cf
commit
4108fda426
45 changed files with 165 additions and 108 deletions
|
|
@ -157,7 +157,7 @@ libvulkan_radeon = shared_library(
|
|||
dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m,
|
||||
dep_valgrind, radv_deps, idep_aco,
|
||||
idep_mesautil, idep_nir, idep_vulkan_util, idep_vulkan_wsi,
|
||||
idep_amdgfxregs_h, idep_xmlconfig,
|
||||
idep_vulkan_runtime, idep_amdgfxregs_h, idep_xmlconfig,
|
||||
],
|
||||
c_args : [no_override_init_args, radv_flags, c_msvc_compat_args],
|
||||
cpp_args : [radv_flags, cpp_msvc_compat_args],
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include "radv_constants.h"
|
||||
|
||||
#include "vulkan/util/vk_object.h"
|
||||
#include "vulkan/runtime/vk_object.h"
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@
|
|||
#include "radv_constants.h"
|
||||
|
||||
#include "nir/nir.h"
|
||||
#include "vulkan/util/vk_object.h"
|
||||
#include "vulkan/util/vk_shader_module.h"
|
||||
#include "vulkan/runtime/vk_object.h"
|
||||
#include "vulkan/runtime/vk_shader_module.h"
|
||||
#include "vulkan/vulkan.h"
|
||||
|
||||
#define RADV_VERT_ATTRIB_MAX MAX2(VERT_ATTRIB_MAX, VERT_ATTRIB_GENERIC0 + MAX_VERTEX_ATTRIBS)
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ v3dv_deps = [
|
|||
idep_nir,
|
||||
idep_nir_headers,
|
||||
idep_vulkan_util,
|
||||
idep_vulkan_runtime,
|
||||
idep_vulkan_wsi,
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#include "compiler/nir/nir_builder.h"
|
||||
#include "vk_format_info.h"
|
||||
#include "util/u_pack_color.h"
|
||||
#include "vulkan/util/vk_common_entrypoints.h"
|
||||
#include "vulkan/runtime/vk_common_entrypoints.h"
|
||||
|
||||
static uint32_t
|
||||
meta_blit_key_hash(const void *key)
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ libvulkan_freedreno = shared_library(
|
|||
idep_nir,
|
||||
tu_deps,
|
||||
idep_vulkan_util,
|
||||
idep_vulkan_runtime,
|
||||
idep_vulkan_wsi,
|
||||
idep_mesautil,
|
||||
],
|
||||
|
|
|
|||
|
|
@ -55,5 +55,6 @@ liblavapipe_st = static_library(
|
|||
c_args : [ c_msvc_compat_args, lvp_flags ],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
include_directories : [ inc_include, inc_src, inc_util, inc_gallium, inc_compiler, inc_gallium_aux ],
|
||||
dependencies : [ idep_nir, idep_mesautil, idep_vulkan_util, idep_vulkan_wsi, lvp_deps ]
|
||||
dependencies : [ idep_nir, idep_mesautil, idep_vulkan_util, idep_vulkan_wsi,
|
||||
idep_vulkan_runtime, lvp_deps ]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ foreach g : [['70', ['gfx7_cmd_buffer.c']], ['75', ['gfx7_cmd_buffer.c']],
|
|||
dependencies : [
|
||||
dep_libdrm, dep_valgrind, idep_nir_headers, idep_genxml,
|
||||
idep_vulkan_util_headers, idep_vulkan_wsi_headers,
|
||||
idep_vulkan_runtime_headers,
|
||||
],
|
||||
)
|
||||
endforeach
|
||||
|
|
@ -118,6 +119,7 @@ anv_deps = [
|
|||
idep_genxml,
|
||||
idep_nir_headers,
|
||||
idep_vulkan_util_headers,
|
||||
idep_vulkan_runtime_headers,
|
||||
idep_vulkan_wsi_headers,
|
||||
]
|
||||
anv_flags = [
|
||||
|
|
@ -175,7 +177,7 @@ libvulkan_intel = shared_library(
|
|||
dependencies : [
|
||||
dep_thread, dep_dl, dep_m, anv_deps, idep_libintel_common,
|
||||
idep_nir, idep_genxml, idep_vulkan_util, idep_vulkan_wsi,
|
||||
idep_mesautil, idep_xmlconfig,
|
||||
idep_vulkan_runtime, idep_mesautil, idep_xmlconfig,
|
||||
],
|
||||
c_args : anv_flags,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
|
|
@ -210,7 +212,8 @@ if with_tests
|
|||
],
|
||||
dependencies : [
|
||||
dep_thread, dep_dl, dep_m, anv_deps,
|
||||
idep_nir, idep_vulkan_util, idep_vulkan_wsi, idep_mesautil,
|
||||
idep_nir, idep_vulkan_util, idep_vulkan_wsi, idep_vulkan_runtime,
|
||||
idep_mesautil,
|
||||
],
|
||||
c_args : anv_flags,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
|
|
@ -229,6 +232,7 @@ if with_tests
|
|||
dependencies : [
|
||||
dep_libdrm, dep_thread, dep_m, dep_valgrind,
|
||||
idep_vulkan_util, idep_vulkan_wsi_headers,
|
||||
idep_vulkan_runtime,
|
||||
],
|
||||
include_directories : [
|
||||
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler,
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ foreach arch : ['5', '6', '7']
|
|||
idep_nir_headers,
|
||||
idep_pan_packers,
|
||||
idep_vulkan_util_headers,
|
||||
idep_vulkan_runtime_headers,
|
||||
idep_vulkan_wsi_headers,
|
||||
dep_libdrm,
|
||||
dep_valgrind,
|
||||
|
|
@ -129,6 +130,7 @@ libvulkan_panfrost = shared_library(
|
|||
idep_pan_packers,
|
||||
panvk_deps,
|
||||
idep_vulkan_util,
|
||||
idep_vulkan_runtime,
|
||||
idep_vulkan_wsi,
|
||||
idep_mesautil,
|
||||
],
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ vn_deps = [
|
|||
dep_thread,
|
||||
idep_mesautil,
|
||||
idep_vulkan_util,
|
||||
idep_vulkan_runtime,
|
||||
idep_vulkan_wsi,
|
||||
idep_xmlconfig,
|
||||
]
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ endif
|
|||
|
||||
|
||||
subdir('util')
|
||||
subdir('runtime')
|
||||
subdir('wsi')
|
||||
if with_vulkan_overlay_layer
|
||||
subdir('overlay-layer')
|
||||
|
|
|
|||
135
src/vulkan/runtime/meson.build
Normal file
135
src/vulkan/runtime/meson.build
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
# Copyright © 2017 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
# Mesa-local imports in the Python files must be declared here for correct
|
||||
# dependency tracking.
|
||||
vk_physical_device_features_gen_depend_files = [
|
||||
]
|
||||
|
||||
files_vulkan_runtime = files(
|
||||
'vk_cmd_copy.c',
|
||||
'vk_command_buffer.c',
|
||||
'vk_command_buffer.h',
|
||||
'vk_debug_report.c',
|
||||
'vk_debug_report.h',
|
||||
'vk_debug_utils.c',
|
||||
'vk_debug_utils.h',
|
||||
'vk_deferred_operation.c',
|
||||
'vk_deferred_operation.h',
|
||||
'vk_descriptors.c',
|
||||
'vk_descriptors.h',
|
||||
'vk_device.c',
|
||||
'vk_device.h',
|
||||
'vk_image.c',
|
||||
'vk_image.h',
|
||||
'vk_instance.c',
|
||||
'vk_instance.h',
|
||||
'vk_log.c',
|
||||
'vk_log.h',
|
||||
'vk_object.c',
|
||||
'vk_object.h',
|
||||
'vk_physical_device.c',
|
||||
'vk_physical_device.h',
|
||||
'vk_queue.c',
|
||||
'vk_queue.h',
|
||||
'vk_render_pass.c',
|
||||
'vk_shader_module.c',
|
||||
'vk_shader_module.h',
|
||||
'vk_synchronization2.c',
|
||||
)
|
||||
|
||||
vk_common_entrypoints = custom_target(
|
||||
'vk_common_entrypoints',
|
||||
input : [vk_entrypoints_gen, vk_api_xml],
|
||||
output : ['vk_common_entrypoints.h', 'vk_common_entrypoints.c'],
|
||||
command : [
|
||||
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
|
||||
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'vk_common',
|
||||
],
|
||||
depend_files : vk_entrypoints_gen_depend_files,
|
||||
)
|
||||
|
||||
vk_cmd_queue = custom_target(
|
||||
'vk_cmd_queue',
|
||||
input : [vk_cmd_queue_gen, vk_api_xml],
|
||||
output : ['vk_cmd_queue.c', 'vk_cmd_queue.h'],
|
||||
command : [
|
||||
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
|
||||
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
|
||||
],
|
||||
depend_files : vk_cmd_queue_gen_depend_files,
|
||||
)
|
||||
|
||||
vk_dispatch_trampolines = custom_target(
|
||||
'vk_dispatch_trampolines',
|
||||
input : [vk_dispatch_trampolines_gen, vk_api_xml],
|
||||
output : ['vk_dispatch_trampolines.c', 'vk_dispatch_trampolines.h'],
|
||||
command : [
|
||||
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
|
||||
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
|
||||
],
|
||||
depend_files : vk_dispatch_trampolines_gen_depend_files,
|
||||
)
|
||||
|
||||
vk_physical_device_features = custom_target(
|
||||
'vk_physical_device_features',
|
||||
input : ['vk_physical_device_features.py', vk_api_xml],
|
||||
output : ['vk_physical_device_features.c'],
|
||||
command : [
|
||||
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
|
||||
'--out-c', '@OUTPUT0@'
|
||||
],
|
||||
depend_files : vk_physical_device_features_gen_depend_files,
|
||||
)
|
||||
|
||||
libvulkan_runtime = static_library(
|
||||
'vulkan_runtime',
|
||||
[files_vulkan_runtime, vk_common_entrypoints, vk_cmd_queue,
|
||||
vk_dispatch_trampolines, vk_physical_device_features],
|
||||
include_directories : [inc_include, inc_src, inc_gallium],
|
||||
dependencies : [vulkan_wsi_deps, idep_mesautil, idep_nir_headers,
|
||||
idep_vulkan_util],
|
||||
# For glsl_type_singleton
|
||||
link_with : libcompiler,
|
||||
c_args : [vulkan_wsi_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
build_by_default : false,
|
||||
)
|
||||
|
||||
idep_vulkan_runtime_headers = declare_dependency(
|
||||
include_directories : include_directories('.')
|
||||
)
|
||||
|
||||
# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine.
|
||||
# See this discussion here:
|
||||
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506
|
||||
if get_option('backend').startswith('vs')
|
||||
idep_vulkan_runtime = declare_dependency(
|
||||
link_with : libvulkan_runtime,
|
||||
dependencies : idep_vulkan_runtime_headers
|
||||
)
|
||||
else
|
||||
idep_vulkan_runtime = declare_dependency(
|
||||
# Instruct users of this library to link with --whole-archive. Otherwise,
|
||||
# our weak function overloads may not resolve properly.
|
||||
link_whole : libvulkan_runtime,
|
||||
dependencies : idep_vulkan_runtime_headers
|
||||
)
|
||||
endif
|
||||
|
|
@ -50,62 +50,22 @@ vk_commands_gen_depend_files = [
|
|||
files('vk_entrypoints.py'),
|
||||
vk_entrypoints_depend_files,
|
||||
]
|
||||
vk_physical_device_features_gen_depend_files = [
|
||||
]
|
||||
|
||||
vk_entrypoints_gen = files('vk_entrypoints_gen.py')
|
||||
vk_extensions_gen = files('vk_extensions_gen.py')
|
||||
vk_icd_gen = files('vk_icd_gen.py')
|
||||
vk_cmd_queue_gen = files('vk_cmd_queue_gen.py')
|
||||
vk_commands_gen = files('vk_commands_gen.py')
|
||||
vk_dispatch_trampolines_gen = files('vk_dispatch_trampolines_gen.py')
|
||||
|
||||
files_vulkan_util = files(
|
||||
'vk_alloc.c',
|
||||
'vk_alloc.h',
|
||||
'vk_cmd_copy.c',
|
||||
'vk_command_buffer.c',
|
||||
'vk_command_buffer.h',
|
||||
'vk_debug_report.c',
|
||||
'vk_debug_report.h',
|
||||
'vk_debug_utils.c',
|
||||
'vk_debug_utils.h',
|
||||
'vk_deferred_operation.c',
|
||||
'vk_deferred_operation.h',
|
||||
'vk_descriptors.c',
|
||||
'vk_descriptors.h',
|
||||
'vk_device.c',
|
||||
'vk_device.h',
|
||||
'vk_format.c',
|
||||
'vk_image.c',
|
||||
'vk_image.h',
|
||||
'vk_instance.c',
|
||||
'vk_instance.h',
|
||||
'vk_log.c',
|
||||
'vk_log.h',
|
||||
'vk_object.c',
|
||||
'vk_object.h',
|
||||
'vk_physical_device.c',
|
||||
'vk_physical_device.h',
|
||||
'vk_queue.c',
|
||||
'vk_queue.h',
|
||||
'vk_render_pass.c',
|
||||
'vk_shader_module.c',
|
||||
'vk_shader_module.h',
|
||||
'vk_synchronization2.c',
|
||||
'vk_util.c',
|
||||
'vk_util.h',
|
||||
)
|
||||
|
||||
vk_common_entrypoints = custom_target(
|
||||
'vk_common_entrypoints',
|
||||
input : [vk_entrypoints_gen, vk_api_xml],
|
||||
output : ['vk_common_entrypoints.h', 'vk_common_entrypoints.c'],
|
||||
command : [
|
||||
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
|
||||
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'vk_common',
|
||||
],
|
||||
depend_files : vk_entrypoints_gen_depend_files,
|
||||
)
|
||||
|
||||
vk_dispatch_table = custom_target(
|
||||
'vk_dispatch_table',
|
||||
input : ['vk_dispatch_table_gen.py', vk_api_xml],
|
||||
|
|
@ -117,17 +77,6 @@ vk_dispatch_table = custom_target(
|
|||
depend_files : vk_dispatch_table_gen_depend_files,
|
||||
)
|
||||
|
||||
vk_dispatch_trampolines = custom_target(
|
||||
'vk_dispatch_trampolines',
|
||||
input : ['vk_dispatch_trampolines_gen.py', vk_api_xml],
|
||||
output : ['vk_dispatch_trampolines.c', 'vk_dispatch_trampolines.h'],
|
||||
command : [
|
||||
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
|
||||
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
|
||||
],
|
||||
depend_files : vk_dispatch_trampolines_gen_depend_files,
|
||||
)
|
||||
|
||||
vk_enum_to_str = custom_target(
|
||||
'vk_enum_to_str',
|
||||
input : ['gen_enum_to_str.py', vk_api_xml],
|
||||
|
|
@ -149,61 +98,22 @@ vk_extensions = custom_target(
|
|||
depend_files : vk_extensions_gen_depend_files,
|
||||
)
|
||||
|
||||
vk_cmd_queue = custom_target(
|
||||
'vk_cmd_queue',
|
||||
input : ['vk_cmd_queue_gen.py', vk_api_xml],
|
||||
output : ['vk_cmd_queue.c', 'vk_cmd_queue.h'],
|
||||
command : [
|
||||
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
|
||||
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
|
||||
],
|
||||
depend_files : vk_cmd_queue_gen_depend_files,
|
||||
)
|
||||
|
||||
vk_physical_device_features = custom_target(
|
||||
'vk_physical_device_features',
|
||||
input : ['vk_physical_device_features.py', vk_api_xml],
|
||||
output : ['vk_physical_device_features.c'],
|
||||
command : [
|
||||
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
|
||||
'--out-c', '@OUTPUT0@'
|
||||
],
|
||||
depend_files : vk_physical_device_features_gen_depend_files,
|
||||
)
|
||||
|
||||
libvulkan_util = static_library(
|
||||
'vulkan_util',
|
||||
[files_vulkan_util, vk_common_entrypoints, vk_dispatch_table,
|
||||
vk_dispatch_trampolines,
|
||||
vk_enum_to_str, vk_extensions, vk_cmd_queue, vk_physical_device_features],
|
||||
[files_vulkan_util, vk_dispatch_table, vk_enum_to_str, vk_extensions],
|
||||
include_directories : [inc_include, inc_src, inc_gallium],
|
||||
dependencies : [vulkan_wsi_deps, idep_mesautil, idep_nir_headers],
|
||||
# For glsl_type_singleton
|
||||
link_with : libcompiler,
|
||||
c_args : [vulkan_wsi_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
build_by_default : false,
|
||||
)
|
||||
|
||||
idep_vulkan_util_headers = declare_dependency(
|
||||
sources : [vk_dispatch_table[1], vk_dispatch_trampolines[1],
|
||||
vk_enum_to_str[1], vk_extensions[1]],
|
||||
sources : [vk_dispatch_table[1], vk_enum_to_str[1], vk_extensions[1]],
|
||||
include_directories : include_directories('.')
|
||||
)
|
||||
|
||||
# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine.
|
||||
# See this discussion here:
|
||||
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506
|
||||
if get_option('backend').startswith('vs')
|
||||
idep_vulkan_util = declare_dependency(
|
||||
link_with : libvulkan_util,
|
||||
dependencies : idep_vulkan_util_headers
|
||||
)
|
||||
else
|
||||
idep_vulkan_util = declare_dependency(
|
||||
# Instruct users of this library to link with --whole-archive. Otherwise,
|
||||
# our weak function overloads may not resolve properly.
|
||||
link_whole : libvulkan_util,
|
||||
dependencies : idep_vulkan_util_headers
|
||||
)
|
||||
endif
|
||||
idep_vulkan_util = declare_dependency(
|
||||
link_with : libvulkan_util,
|
||||
dependencies : idep_vulkan_util_headers
|
||||
)
|
||||
|
|
|
|||
|
|
@ -60,7 +60,8 @@ libvulkan_wsi = static_library(
|
|||
[files_vulkan_wsi, wsi_entrypoints],
|
||||
include_directories : [inc_include, inc_src],
|
||||
dependencies : [
|
||||
vulkan_wsi_deps, dep_libdrm, idep_vulkan_util_headers, idep_xmlconfig,
|
||||
vulkan_wsi_deps, dep_libdrm, idep_vulkan_util_headers,
|
||||
idep_vulkan_runtime_headers, idep_xmlconfig,
|
||||
],
|
||||
c_args : [vulkan_wsi_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#define WSI_COMMON_PRIVATE_H
|
||||
|
||||
#include "wsi_common.h"
|
||||
#include "vulkan/util/vk_object.h"
|
||||
#include "vulkan/runtime/vk_object.h"
|
||||
|
||||
struct wsi_image {
|
||||
VkImage image;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue