| 1 |
# Copyright © 2022 Collabora Ltd. and Red Hat Inc. |
| 2 |
# SPDX-License-Identifier: MIT |
| 3 |
hk_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 |
|
| 52 |
hk_entrypoints = custom_target( |
| 53 |
input : [vk_entrypoints_gen, vk_api_xml], |
| 54 |
output : ['hk_entrypoints.h', 'hk_entrypoints.c'], |
| 55 |
command : [ |
| 56 |
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak', |
| 57 |
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'hk', |
| 58 |
'--beta', with_vulkan_beta.to_string(), |
| 59 |
], |
| 60 |
depend_files : vk_entrypoints_gen_depend_files, |
| 61 |
) |
| 62 |
|
| 63 |
hk_deps = [ |
| 64 |
dep_libdrm, |
| 65 |
idep_nir, |
| 66 |
idep_vulkan_runtime, |
| 67 |
idep_vulkan_util, |
| 68 |
idep_vulkan_wsi, |
| 69 |
idep_vulkan_wsi_headers, |
| 70 |
idep_agx_pack, |
| 71 |
idep_libagx, |
| 72 |
idep_libagx_shaders_h, |
| 73 |
] |
| 74 |
|
| 75 |
libhk = static_library( |
| 76 |
'hk', |
| 77 |
[ |
| 78 |
hk_entrypoints, |
| 79 |
hk_files, |
| 80 |
sha1_h, |
| 81 |
], |
| 82 |
include_directories : [ |
| 83 |
inc_gallium, |
| 84 |
inc_gallium_aux, |
| 85 |
inc_include, |
| 86 |
inc_src, |
| 87 |
inc_asahi, |
| 88 |
inc_virtio_gpu, |
| 89 |
inc_virtio_vdrm, |
| 90 |
], |
| 91 |
link_with : [libasahi_lib, libasahi_layout, libasahi_compiler], |
| 92 |
c_args : ['-Wno-c2x-extensions'], |
| 93 |
dependencies : [hk_deps], |
| 94 |
gnu_symbol_visibility : 'hidden', |
| 95 |
) |
| 96 |
|
| 97 |
libvulkan_asahi = shared_library( |
| 98 |
'vulkan_asahi', |
| 99 |
link_whole : [libhk], |
| 100 |
link_args: [ld_args_build_id], |
| 101 |
gnu_symbol_visibility : 'hidden', |
| 102 |
install : true, |
| 103 |
) |
| 104 |
|
| 105 |
icd_file_name = libname_prefix + 'vulkan_asahi.' + libname_suffix |
| 106 |
|
| 107 |
asahi_icd = custom_target( |
| 108 |
input : [vk_icd_gen, vk_api_xml], |
| 109 |
output : 'asahi_icd.' + vulkan_manifest_suffix, |
| 110 |
command : [ |
| 111 |
prog_python, '@INPUT0@', |
| 112 |
'--api-version', '1.4', '--xml', '@INPUT1@', |
| 113 |
'--sizeof-pointer', sizeof_pointer, |
| 114 |
'--icd-lib-path', vulkan_icd_lib_path, |
| 115 |
'--icd-filename', icd_file_name, |
| 116 |
'--out', '@OUTPUT@', |
| 117 |
], |
| 118 |
build_by_default : true, |
| 119 |
install_dir : with_vulkan_icd_dir, |
| 120 |
install_tag : 'runtime', |
| 121 |
install : true, |
| 122 |
) |
| 123 |
|
| 124 |
_dev_icdname = 'asahi_devenv_icd.@[email protected]'.format(host_machine.cpu()) |
| 125 |
_dev_icd = custom_target( |
| 126 |
input : [vk_icd_gen, vk_api_xml], |
| 127 |
output : _dev_icdname, |
| 128 |
command : [ |
| 129 |
prog_python, '@INPUT0@', |
| 130 |
'--api-version', '1.4', '--xml', '@INPUT1@', |
| 131 |
'--sizeof-pointer', sizeof_pointer, |
| 132 |
'--icd-lib-path', meson.current_build_dir(), |
| 133 |
'--icd-filename', icd_file_name, |
| 134 |
'--out', '@OUTPUT@', |
| 135 |
], |
| 136 |
build_by_default : true, |
| 137 |
) |
| 138 |
|
| 139 |
devenv.append('VK_DRIVER_FILES', _dev_icd.full_path()) |