• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2019 Raspberry Pi Ltd
2# SPDX-License-Identifier: MIT
3
4v3dv_entrypoints = custom_target(
5  'v3dv_entrypoints',
6  input : [vk_entrypoints_gen, vk_api_xml],
7  output : ['v3dv_entrypoints.h', 'v3dv_entrypoints.c'],
8  command : [
9    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
10    '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'v3dv',
11    '--beta', with_vulkan_beta.to_string(),
12    '--device-prefix', 'ver42',
13    '--device-prefix', 'ver71',
14  ],
15  depend_files : vk_entrypoints_gen_depend_files,
16)
17
18libv3dv_files = files(
19  'v3dv_bo.c',
20  'v3dv_cl.c',
21  'v3dv_cmd_buffer.c',
22  'v3dv_descriptor_set.c',
23  'v3dv_device.c',
24  'v3dv_event.c',
25  'v3dv_formats.c',
26  'v3dv_image.c',
27  'v3dv_limits.h',
28  'v3dv_meta_clear.c',
29  'v3dv_meta_copy.c',
30  'v3dv_pass.c',
31  'v3dv_pipeline.c',
32  'v3dv_pipeline_cache.c',
33  'v3dv_private.h',
34  'v3dv_query.c',
35  'v3dv_queue.c',
36  'v3dv_uniforms.c',
37  'v3dv_wsi.c',
38) + [v3d_xml_pack]
39
40files_per_version = files(
41  'v3dvx_cmd_buffer.c',
42  'v3dvx_descriptor_set.c',
43  'v3dvx_device.c',
44  'v3dvx_formats.c',
45  'v3dvx_image.c',
46  'v3dvx_pipeline.c',
47  'v3dvx_meta_common.c',
48  'v3dvx_pipeline.c',
49  'v3dvx_queue.c',
50)
51
52v3d_versions = ['42', '71']
53
54v3dv_flags = [v3d_simulator_arg]
55
56v3dv_deps = [
57  dep_dl,
58  dep_libdrm,
59  dep_valgrind,
60  dep_v3d_hw,
61  idep_broadcom_perfcntrs,
62  idep_nir,
63  idep_nir_headers,
64  idep_vulkan_util,
65  idep_vulkan_runtime,
66  idep_vulkan_wsi,
67  idep_mesautil,
68]
69
70if with_platform_x11
71  v3dv_deps += dep_xcb_dri3
72endif
73
74if with_platform_wayland
75  v3dv_deps += dep_wayland_client
76  libv3dv_files += [wayland_drm_client_protocol_h, wayland_drm_protocol_c]
77endif
78
79if with_platform_android
80  v3dv_deps += [dep_android, idep_u_gralloc]
81  v3dv_flags += '-DVK_USE_PLATFORM_ANDROID_KHR'
82  libv3dv_files += files('v3dv_android.c')
83endif
84
85per_version_libs = []
86foreach ver : v3d_versions
87  per_version_libs += static_library(
88    'v3dv-v' + ver,
89    [files_per_version, v3d_xml_pack, v3dv_entrypoints[0]],
90    include_directories : [
91      inc_src, inc_include, inc_broadcom,
92      inc_util,
93    ],
94    c_args : [v3dv_flags, '-DV3D_VERSION=' + ver],
95    gnu_symbol_visibility : 'hidden',
96    dependencies : [v3dv_deps],
97)
98endforeach
99
100libvulkan_broadcom = shared_library(
101  'vulkan_broadcom',
102  [libv3dv_files, v3dv_entrypoints, sha1_h],
103  include_directories : [
104    inc_include, inc_src, inc_broadcom, inc_util,
105  ],
106  link_with : [
107    libbroadcom_cle,
108    libbroadcom_v3d,
109    per_version_libs,
110  ],
111  dependencies : v3dv_deps,
112  c_args : v3dv_flags,
113  link_args : [vulkan_icd_link_args, '-Wl,--build-id=sha1', ld_args_bsymbolic, ld_args_gc_sections],
114  link_depends : vulkan_icd_link_depends,
115  gnu_symbol_visibility : 'hidden',
116  install : true,
117)
118
119if with_symbols_check
120  test(
121    'v3dv symbols check',
122    symbols_check,
123    args : [
124      '--lib', libvulkan_broadcom,
125      '--symbols-file', vulkan_icd_symbols,
126      symbols_check_args,
127    ],
128    suite : ['broadcom'],
129  )
130endif
131
132broadcom_icd = custom_target(
133  'broadcom_icd',
134  input : [vk_icd_gen, vk_api_xml],
135  output : 'broadcom_icd.@0@.json'.format(host_machine.cpu()),
136  command : [
137    prog_python, '@INPUT0@',
138    '--api-version', '1.3', '--xml', '@INPUT1@',
139    '--lib-path', join_paths(get_option('prefix'), get_option('libdir'),
140    		  	     'libvulkan_broadcom.so'),
141    '--out', '@OUTPUT@',
142  ],
143  build_by_default : true,
144  install_dir : with_vulkan_icd_dir,
145  install_tag : 'runtime',
146  install : true,
147)
148
149_dev_icdname = 'broadcom_devenv_icd.@0@.json'.format(host_machine.cpu())
150_dev_icd = custom_target(
151  'broadcom_devenv_icd',
152  input : [vk_icd_gen, vk_api_xml],
153  output : _dev_icdname,
154  command : [
155    prog_python, '@INPUT0@',
156    '--api-version', '1.3', '--xml', '@INPUT1@',
157    '--lib-path', meson.current_build_dir() / 'libvulkan_broadcom.so',
158    '--out', '@OUTPUT@',
159  ],
160  build_by_default : true,
161)
162
163devenv.append('VK_DRIVER_FILES', _dev_icd.full_path())
164# Deprecated: replaced by VK_DRIVER_FILES above
165devenv.append('VK_ICD_FILENAMES', _dev_icd.full_path())
166