1# Copyright © 2022 Collabora Ltd. and Red Hat Inc. 2# SPDX-License-Identifier: MIT 3nvk_files = files( 4 '../../gallium/auxiliary/tgsi/tgsi_from_mesa.c', 5 'nvk_buffer.c', 6 'nvk_buffer.h', 7 'nvk_buffer_view.c', 8 'nvk_buffer_view.h', 9 'nvk_cmd_buffer.c', 10 'nvk_cmd_buffer.h', 11 'nvk_cmd_clear.c', 12 'nvk_cmd_copy.c', 13 'nvk_cmd_dispatch.c', 14 'nvk_cmd_draw.c', 15 'nvk_cmd_meta.c', 16 'nvk_cmd_pool.c', 17 'nvk_cmd_pool.h', 18 'nvk_codegen.c', 19 'nvk_descriptor_set.h', 20 'nvk_descriptor_set.c', 21 'nvk_descriptor_set_layout.c', 22 'nvk_descriptor_set_layout.h', 23 'nvk_descriptor_table.c', 24 'nvk_descriptor_table.h', 25 'nvk_device.c', 26 'nvk_device.h', 27 'nvk_device_memory.c', 28 'nvk_device_memory.h', 29 'nvk_event.c', 30 'nvk_event.h', 31 'nvk_format.c', 32 'nvk_format.h', 33 'nvk_heap.c', 34 'nvk_heap.h', 35 'nvk_image.c', 36 'nvk_image.h', 37 'nvk_image_view.c', 38 'nvk_image_view.h', 39 'nvk_instance.c', 40 'nvk_instance.h', 41 'nvk_mme.c', 42 'nvk_mme.h', 43 'nvk_nir_lower_descriptors.c', 44 'nvk_physical_device.c', 45 'nvk_physical_device.h', 46 'nvk_private.h', 47 'nvk_query_pool.c', 48 'nvk_query_pool.h', 49 'nvk_queue.c', 50 'nvk_queue.h', 51 'nvk_queue_drm_nouveau.c', 52 'nvk_sampler.c', 53 'nvk_sampler.h', 54 'nvk_shader.c', 55 'nvk_shader.h', 56 'nvk_upload_queue.c', 57 'nvk_upload_queue.h', 58 'nvk_wsi.c', 59 'nvk_wsi.h' 60) 61 62nvk_entrypoints = custom_target( 63 'nvk_entrypoints', 64 input : [vk_entrypoints_gen, vk_api_xml], 65 output : ['nvk_entrypoints.h', 'nvk_entrypoints.c'], 66 command : [ 67 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak', 68 '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'nvk', 69 '--beta', with_vulkan_beta.to_string(), 70 ], 71 depend_files : vk_entrypoints_gen_depend_files, 72) 73 74nvk_deps = [ 75 dep_libdrm, 76 idep_nak, 77 idep_nil, 78 idep_nir, 79 idep_nouveau_mme, 80 idep_nouveau_ws, 81 idep_nvidia_headers, 82 idep_vulkan_runtime, 83 idep_vulkan_util, 84 idep_vulkan_wsi, 85 idep_vulkan_wsi_headers, 86] 87 88libnvk = static_library( 89 'nvk', 90 [ 91 nvk_entrypoints, 92 cl_generated, 93 nvk_files, 94 ], 95 include_directories : [ 96 inc_gallium, 97 inc_gallium_aux, 98 inc_include, 99 inc_src, 100 ], 101 link_with : [libnouveau_codegen], 102 dependencies : [nvk_deps, idep_nouveau_codegen], 103 gnu_symbol_visibility : 'hidden', 104) 105 106libvulkan_nouveau = shared_library( 107 'vulkan_nouveau', 108 link_whole : [libnvk], 109 link_args: [ld_args_build_id], 110 gnu_symbol_visibility : 'hidden', 111 install : true, 112) 113 114icd_lib_path = join_paths(get_option('prefix'), get_option('libdir')) 115icd_file_name = 'libvulkan_nouveau.so' 116if with_platform_windows 117 icd_lib_path = join_paths(get_option('prefix'), get_option('bindir')) 118 icd_file_name = 'vulkan_nouveau.dll' 119endif 120 121nouveau_icd = custom_target( 122 'nouveau_icd', 123 input : [vk_icd_gen, vk_api_xml], 124 output : 'nouveau_icd.@0@.json'.format(host_machine.cpu()), 125 command : [ 126 prog_python, '@INPUT0@', 127 '--api-version', '1.3', '--xml', '@INPUT1@', 128 '--lib-path', join_paths(icd_lib_path, icd_file_name), 129 '--out', '@OUTPUT@', 130 ], 131 build_by_default : true, 132 install_dir : with_vulkan_icd_dir, 133 install_tag : 'runtime', 134 install : true, 135) 136 137if meson.version().version_compare('>= 0.58') 138 _dev_icdname = 'nouveau_devenv_icd.@0@.json'.format(host_machine.cpu()) 139 custom_target( 140 'nouveau_devenv_icd', 141 input : [vk_icd_gen, vk_api_xml], 142 output : _dev_icdname, 143 command : [ 144 prog_python, '@INPUT0@', 145 '--api-version', '1.3', '--xml', '@INPUT1@', 146 '--lib-path', meson.current_build_dir() / icd_file_name, 147 '--out', '@OUTPUT@', 148 ], 149 build_by_default : true, 150 ) 151 152 devenv.append('VK_ICD_FILENAMES', meson.current_build_dir() / _dev_icdname) 153endif 154 155if with_tests and not with_platform_android 156 test( 157 'nvk_mme', 158 executable( 159 'test_nvk_mme', 160 files('test_nvk_mme.c'), 161 dependencies : [nvk_deps], 162 link_with : [libnvk], 163 ) 164 ) 165endif 166