• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2022 Collabora Ltd. and Red Hat Inc.
2# SPDX-License-Identifier: MIT
3hk_files = files(
4  'hk_buffer.c',
5  'hk_buffer.h',
6  'hk_buffer_view.c',
7  'hk_buffer_view.h',
8  'hk_cmd_buffer.c',
9  'hk_cmd_buffer.h',
10  'hk_cmd_clear.c',
11  'hk_cmd_dispatch.c',
12  'hk_cmd_draw.c',
13  'hk_cmd_meta.c',
14  'hk_cmd_pool.c',
15  'hk_cmd_pool.h',
16  'hk_descriptor_set.h',
17  'hk_descriptor_set.c',
18  'hk_descriptor_set_layout.c',
19  'hk_descriptor_set_layout.h',
20  'hk_descriptor_table.c',
21  'hk_descriptor_table.h',
22  'hk_device.c',
23  'hk_device.h',
24  'hk_device_memory.c',
25  'hk_device_memory.h',
26  'hk_event.c',
27  'hk_event.h',
28  'hk_format.c',
29  'hk_image.c',
30  'hk_image.h',
31  'hk_image_view.c',
32  'hk_image_view.h',
33  'hk_instance.c',
34  'hk_instance.h',
35  'hk_nir_lower_descriptors.c',
36  'hk_nir_passthrough_gs.c',
37  'hk_physical_device.c',
38  'hk_physical_device.h',
39  'hk_private.h',
40  'hk_query_pool.c',
41  'hk_query_pool.h',
42  'hk_queue.c',
43  'hk_queue.h',
44  'hk_sampler.c',
45  'hk_sampler.h',
46  'hk_shader.c',
47  'hk_shader.h',
48  'hk_wsi.c',
49  'hk_wsi.h'
50)
51
52hk_entrypoints = custom_target(
53  'hk_entrypoints',
54  input : [vk_entrypoints_gen, vk_api_xml],
55  output : ['hk_entrypoints.h', 'hk_entrypoints.c'],
56  command : [
57    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
58    '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'hk',
59    '--beta', with_vulkan_beta.to_string(),
60  ],
61  depend_files : vk_entrypoints_gen_depend_files,
62)
63
64hk_deps = [
65  dep_libdrm,
66  idep_nir,
67  idep_vulkan_runtime,
68  idep_vulkan_util,
69  idep_vulkan_wsi,
70  idep_vulkan_wsi_headers,
71  idep_agx_pack,
72  idep_libagx,
73  idep_libagx_shaders_h,
74]
75
76libhk = static_library(
77  'hk',
78  [
79    hk_entrypoints,
80    hk_files,
81    sha1_h,
82  ],
83  include_directories : [
84    inc_gallium,
85    inc_gallium_aux,
86    inc_include,
87    inc_src,
88    inc_asahi,
89    inc_virtio_gpu,
90    inc_virtio_vdrm,
91  ],
92  link_with : [libasahi_lib, libasahi_layout, libasahi_compiler],
93  c_args : ['-Wno-c2x-extensions'],
94  dependencies : [hk_deps],
95  gnu_symbol_visibility : 'hidden',
96)
97
98libvulkan_asahi = shared_library(
99  'vulkan_asahi',
100  link_whole : [libhk],
101  link_args: [ld_args_build_id],
102  gnu_symbol_visibility : 'hidden',
103  install : true,
104)
105
106icd_lib_path = join_paths(get_option('prefix'), get_option('libdir'))
107icd_file_name = 'libvulkan_asahi.so'
108if with_platform_windows
109  icd_lib_path = import('fs').relative_to(get_option('bindir'), with_vulkan_icd_dir)
110  icd_file_name = 'vulkan_asahi.dll'
111endif
112
113asahi_icd = custom_target(
114  'asahi_icd',
115  input : [vk_icd_gen, vk_api_xml],
116  output : 'asahi_icd.@0@.json'.format(host_machine.cpu()),
117  command : [
118    prog_python, '@INPUT0@',
119    '--api-version', '1.4', '--xml', '@INPUT1@',
120    '--lib-path', join_paths(icd_lib_path, icd_file_name),
121    '--out', '@OUTPUT@',
122  ],
123  build_by_default : true,
124  install_dir : with_vulkan_icd_dir,
125  install_tag : 'runtime',
126  install : true,
127)
128
129_dev_icdname = 'asahi_devenv_icd.@0@.json'.format(host_machine.cpu())
130custom_target(
131  'asahi_devenv_icd',
132  input : [vk_icd_gen, vk_api_xml],
133  output : _dev_icdname,
134  command : [
135    prog_python, '@INPUT0@',
136    '--api-version', '1.4', '--xml', '@INPUT1@',
137    '--lib-path', meson.current_build_dir() / icd_file_name,
138    '--out', '@OUTPUT@',
139  ],
140  build_by_default : true,
141)
142
143devenv.append('VK_DRIVER_FILES', meson.current_build_dir() / _dev_icdname)
144# Deprecated: replaced by VK_DRIVER_FILES above
145devenv.append('VK_ICD_FILENAMES', meson.current_build_dir() / _dev_icdname)
146