• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2017 Intel Corporation
2
3# Permission is hereby granted, free of charge, to any person obtaining a copy
4# of this software and associated documentation files (the "Software"), to deal
5# in the Software without restriction, including without limitation the rights
6# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7# copies of the Software, and to permit persons to whom the Software is
8# furnished to do so, subject to the following conditions:
9
10# The above copyright notice and this permission notice shall be included in
11# all copies or substantial portions of the Software.
12
13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19# SOFTWARE.
20
21# Mesa-local imports in the Python files must be declared here for correct
22# dependency tracking.
23vk_physical_device_features_gen_depend_files = [
24]
25
26vulkan_runtime_files = files(
27  'vk_buffer.c',
28  'vk_buffer.h',
29  'vk_cmd_copy.c',
30  'vk_cmd_enqueue.c',
31  'vk_command_buffer.c',
32  'vk_command_buffer.h',
33  'vk_command_pool.c',
34  'vk_command_pool.h',
35  'vk_debug_report.c',
36  'vk_debug_report.h',
37  'vk_debug_utils.c',
38  'vk_debug_utils.h',
39  'vk_deferred_operation.c',
40  'vk_deferred_operation.h',
41  'vk_descriptor_set_layout.c',
42  'vk_descriptor_set_layout.h',
43  'vk_descriptors.c',
44  'vk_descriptors.h',
45  'vk_device.c',
46  'vk_device.h',
47  'vk_fence.c',
48  'vk_fence.h',
49  'vk_framebuffer.c',
50  'vk_framebuffer.h',
51  'vk_graphics_state.c',
52  'vk_graphics_state.h',
53  'vk_image.c',
54  'vk_image.h',
55  'vk_instance.c',
56  'vk_instance.h',
57  'vk_log.c',
58  'vk_log.h',
59  'vk_nir.c',
60  'vk_nir.h',
61  'vk_object.c',
62  'vk_object.h',
63  'vk_pipeline.c',
64  'vk_pipeline.h',
65  'vk_pipeline_cache.c',
66  'vk_pipeline_cache.h',
67  'vk_physical_device.c',
68  'vk_physical_device.h',
69  'vk_pipeline_layout.c',
70  'vk_pipeline_layout.h',
71  'vk_queue.c',
72  'vk_queue.h',
73  'vk_render_pass.c',
74  'vk_sampler.c',
75  'vk_sampler.h',
76  'vk_semaphore.c',
77  'vk_semaphore.h',
78  'vk_shader_module.c',
79  'vk_shader_module.h',
80  'vk_standard_sample_locations.c',
81  'vk_standard_sample_locations.h',
82  'vk_sync.c',
83  'vk_sync.h',
84  'vk_sync_binary.c',
85  'vk_sync_binary.h',
86  'vk_sync_dummy.c',
87  'vk_sync_dummy.h',
88  'vk_sync_timeline.c',
89  'vk_sync_timeline.h',
90  'vk_synchronization2.c',
91)
92
93vulkan_runtime_deps = [
94  vulkan_wsi_deps,
95  idep_mesautil,
96  idep_nir,
97  idep_vulkan_util,
98]
99
100if dep_libdrm.found()
101  vulkan_runtime_files += files('vk_drm_syncobj.c', 'vk_drm_syncobj.h')
102  vulkan_runtime_deps += dep_libdrm
103endif
104
105if with_platform_android
106  vulkan_runtime_files += files('vk_android.c')
107  vulkan_runtime_deps += dep_android
108endif
109
110vk_common_entrypoints = custom_target(
111  'vk_common_entrypoints',
112  input : [vk_entrypoints_gen, vk_api_xml],
113  output : ['vk_common_entrypoints.h', 'vk_common_entrypoints.c'],
114  command : [
115    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
116    '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'vk_common',
117  ],
118  depend_files : vk_entrypoints_gen_depend_files,
119)
120
121vk_cmd_queue = custom_target(
122  'vk_cmd_queue',
123  input : [vk_cmd_queue_gen, vk_api_xml],
124  output : ['vk_cmd_queue.c', 'vk_cmd_queue.h'],
125  command : [
126    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
127    '--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
128  ],
129  depend_files : vk_cmd_queue_gen_depend_files,
130)
131
132vk_cmd_enqueue_entrypoints = custom_target(
133  'vk_cmd_enqueue_entrypoints',
134  input : [vk_entrypoints_gen, vk_api_xml],
135  output : ['vk_cmd_enqueue_entrypoints.h', 'vk_cmd_enqueue_entrypoints.c'],
136  command : [
137    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
138    '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@',
139    '--prefix', 'vk_cmd_enqueue', '--prefix', 'vk_cmd_enqueue_unless_primary',
140  ],
141  depend_files : vk_entrypoints_gen_depend_files,
142)
143
144vk_dispatch_trampolines = custom_target(
145  'vk_dispatch_trampolines',
146  input : [vk_dispatch_trampolines_gen, vk_api_xml],
147  output : ['vk_dispatch_trampolines.c', 'vk_dispatch_trampolines.h'],
148  command : [
149    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
150    '--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
151  ],
152  depend_files : vk_dispatch_trampolines_gen_depend_files,
153)
154
155vk_physical_device_features = custom_target(
156  'vk_physical_device_features',
157  input : ['vk_physical_device_features.py', vk_api_xml],
158  output : ['vk_physical_device_features.c'],
159  command : [
160    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
161    '--out-c', '@OUTPUT0@'
162  ],
163  depend_files : vk_physical_device_features_gen_depend_files,
164)
165
166libvulkan_runtime = static_library(
167  'vulkan_runtime',
168  [vulkan_runtime_files, vk_common_entrypoints,
169   vk_cmd_queue, vk_cmd_enqueue_entrypoints,
170   vk_dispatch_trampolines, vk_physical_device_features],
171  include_directories : [inc_include, inc_src, inc_gallium],
172  dependencies : vulkan_runtime_deps,
173  # For glsl_type_singleton
174  link_with : libcompiler,
175  c_args : [c_msvc_compat_args],
176  gnu_symbol_visibility : 'hidden',
177  build_by_default : false,
178)
179
180idep_vulkan_runtime_headers = declare_dependency(
181  sources : [vk_cmd_queue[1]],
182  include_directories : include_directories('.')
183)
184
185idep_vulkan_common_entrypoints_h = declare_dependency(
186  sources : [vk_common_entrypoints[0]]
187)
188
189# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine.
190# See this discussion here:
191# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506
192if get_option('backend').startswith('vs')
193  idep_vulkan_runtime = declare_dependency(
194    link_with : libvulkan_runtime,
195    dependencies : idep_vulkan_runtime_headers
196  )
197else
198  idep_vulkan_runtime = declare_dependency(
199    # Instruct users of this library to link with --whole-archive.  Otherwise,
200    # our weak function overloads may not resolve properly.
201    link_whole : libvulkan_runtime,
202    dependencies : idep_vulkan_runtime_headers
203  )
204endif
205