summaryrefslogtreecommitdiff
path: root/src/panfrost/vulkan/meson.build
blob: 06d95d4c6b08e6f07f891847c1e0df76809b3382 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Copyright © 2021 Collabora Ltd.
#
# Derived from the freedreno driver which is:
# Copyright © 2017 Intel Corporation

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

panvk_entrypoints = custom_target(
  'panvk_entrypoints.[ch]',
  input : [vk_entrypoints_gen, vk_api_xml],
  output : ['panvk_entrypoints.h', 'panvk_entrypoints.c'],
  command : [
    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
    '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'panvk',
  ],
)

libpanvk_files = files(
  'panvk_cmd_buffer.c',
  'panvk_cs.c',
  'panvk_device.c',
  'panvk_descriptor_set.c',
  'panvk_formats.c',
  'panvk_image.c',
  'panvk_meta.c',
  'panvk_pass.c',
  'panvk_pipeline.c',
  'panvk_pipeline_cache.c',
  'panvk_private.h',
  'panvk_query.c',
  'panvk_shader.c',
  'panvk_sync.c',
  'panvk_util.c',
  'panvk_varyings.c',
  'panvk_wsi.c',
  'panvk_wsi_display.c',
)

panvk_deps = []
panvk_flags = []

if system_has_kms_drm
  panvk_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
  libpanvk_files += files('panvk_wsi_display.c')
endif

if with_platform_wayland
  panvk_deps += [dep_wayland_client, dep_wl_protocols]
  panvk_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
  libpanvk_files += files('panvk_wsi_wayland.c')
  libpanvk_files += [wayland_drm_client_protocol_h, wayland_drm_protocol_c]
endif

libvulkan_panfrost = shared_library(
  'vulkan_panfrost',
  [libpanvk_files, panvk_entrypoints],
  include_directories : [
    inc_include,
    inc_src,
    inc_compiler,
    inc_gallium, # XXX: pipe/p_format.h
    inc_gallium_aux, # XXX: renderonly
    inc_vulkan_wsi,
    inc_panfrost,
  ],
  link_with : [
    libvulkan_wsi,
    libpanfrost_shared,
    libpanfrost_midgard,
    libpanfrost_bifrost,
    libpanfrost_decode,
    libpanfrost_lib,
    libpanfrost_util,
  ],
  dependencies : [
    dep_dl,
    dep_elf,
    dep_libdrm,
    dep_m,
    dep_thread,
    dep_valgrind,
    idep_nir,
    panvk_deps,
    idep_vulkan_util,
    idep_mesautil,
  ],
  c_args : [no_override_init_args, panvk_flags],
  link_args : [ld_args_bsymbolic, ld_args_gc_sections],
  install : true,
)

panfrost_icd = custom_target(
  'panfrost_icd',
  input : [vk_icd_gen, vk_api_xml],
  output : 'panfrost_icd.@0@.json'.format(host_machine.cpu()),
  command : [
    prog_python, '@INPUT0@',
    '--api-version', '1.1', '--xml', '@INPUT1@',
    '--lib-path', join_paths(get_option('prefix'), get_option('libdir'),
                             'libvulkan_panfrost.so'),
    '--out', '@OUTPUT@',
  ],
  build_by_default : true,
  install_dir : with_vulkan_icd_dir,
  install : true,
)