• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package {
18    // See: http://go/android-license-faq
19    default_applicable_licenses: ["external_mesa3d_license"],
20}
21
22python_binary_host {
23    name: "vk_format_info_gen",
24    main: "vk_format_info_gen.py",
25    srcs: ["vk_format_info_gen.py"],
26    libs: [
27        "mako",
28    ],
29}
30
31genrule {
32    name: "vk_cmd_queue_header",
33    srcs: [":mesa_vulkan_xml"],
34    out: ["vk_cmd_queue.h"],
35    tools: ["vk_cmd_queue_gen"],
36    cmd: "python3 $(location vk_cmd_queue_gen) --xml " +
37        "$(location :mesa_vulkan_xml) --out-h " +
38        "$(location vk_cmd_queue.h) --out-c " +
39        "$(genDir)/placeholder.c --beta false",
40}
41
42genrule {
43    name: "vk_cmd_queue_impl",
44    srcs: [":mesa_vulkan_xml"],
45    out: ["vk_cmd_queue.c"],
46    tools: ["vk_cmd_queue_gen"],
47    cmd: "python3 $(location vk_cmd_queue_gen) --xml " +
48        "$(location :mesa_vulkan_xml) --out-c " +
49        "$(location vk_cmd_queue.c) --out-h " +
50        "$(genDir)/vk_cmd_queue.h --beta false",
51}
52
53genrule {
54    name: "vk_common_entrypoints_header",
55    srcs: [":mesa_vulkan_xml"],
56    out: ["vk_common_entrypoints.h"],
57    tools: ["vk_entrypoints_gen"],
58    cmd: "python3 $(location vk_entrypoints_gen) --xml " +
59        "$(location :mesa_vulkan_xml) --proto --weak --out-h " +
60        "$(location vk_common_entrypoints.h) --out-c " +
61        "$(genDir)/placeholder.c --prefix vk_common --beta false",
62}
63
64genrule {
65    name: "vk_common_entrypoints_impl",
66    srcs: [":mesa_vulkan_xml"],
67    out: ["vk_common_entrypoints.c"],
68    tools: ["vk_entrypoints_gen"],
69    cmd: "python3 $(location vk_entrypoints_gen) --xml " +
70        "$(location :mesa_vulkan_xml) --proto --weak --out-h " +
71        "$(genDir)/vk_common_entrypoints.h --out-c " +
72        "$(location vk_common_entrypoints.c) --prefix vk_common " +
73        "--beta false",
74}
75
76genrule {
77    name: "vk_cmd_enqueue_entrypoints_header",
78    srcs: [":mesa_vulkan_xml"],
79    out: ["vk_cmd_enqueue_entrypoints.h"],
80    tools: ["vk_entrypoints_gen"],
81    cmd: "python3 $(location vk_entrypoints_gen) --xml " +
82        "$(location :mesa_vulkan_xml) --proto --weak --out-h " +
83        "$(location vk_cmd_enqueue_entrypoints.h) --out-c " +
84        "$(genDir)/placeholder.c --prefix vk_cmd_enqueue " +
85        " --prefix vk_cmd_enqueue_unless_primary --beta false",
86}
87
88genrule {
89    name: "vk_cmd_enqueue_entrypoints_impl",
90    srcs: [":mesa_vulkan_xml"],
91    out: ["vk_cmd_enqueue_entrypoints.c"],
92    tools: ["vk_entrypoints_gen"],
93    cmd: "python3 $(location vk_entrypoints_gen) --xml " +
94        "$(location :mesa_vulkan_xml) --proto --weak --out-h " +
95        "$(genDir)/vk_cmd_enqueue_entrypoints.h --out-c " +
96        "$(location vk_cmd_enqueue_entrypoints.c) --prefix vk_cmd_enqueue " +
97        "--prefix vk_cmd_enqueue_unless_primary --beta false",
98}
99
100genrule {
101    name: "vk_dispatch_trampolines_header",
102    srcs: [":mesa_vulkan_xml"],
103    out: ["vk_dispatch_trampolines.h"],
104    tools: ["vk_dispatch_trampolines_gen"],
105    cmd: "python3 $(location vk_dispatch_trampolines_gen) --xml " +
106        "$(location :mesa_vulkan_xml) --out-h " +
107        "$(location vk_dispatch_trampolines.h) --out-c " +
108        "$(genDir)/placeholder.c --beta false",
109}
110
111genrule {
112    name: "vk_dispatch_trampolines_impl",
113    srcs: [":mesa_vulkan_xml"],
114    out: ["vk_dispatch_trampolines.c"],
115    tools: ["vk_dispatch_trampolines_gen"],
116    cmd: "python3 $(location vk_dispatch_trampolines_gen) --xml " +
117        "$(location :mesa_vulkan_xml)  --out-h " +
118        "$(genDir)/vk_dispatch_trampolines.h --out-c " +
119        "$(location vk_dispatch_trampolines.c) --beta false",
120}
121
122genrule {
123    name: "vk_physical_device_features_header",
124    srcs: [":mesa_vulkan_xml"],
125    out: ["vk_physical_device_features.h"],
126    tools: ["vk_physical_device_features_gen"],
127    cmd: "python3 $(location vk_physical_device_features_gen) --xml " +
128        "$(location :mesa_vulkan_xml) --out-h " +
129        "$(location vk_physical_device_features.h) --out-c " +
130        "$(genDir)/placeholder.c --beta false",
131}
132
133genrule {
134    name: "vk_physical_device_features_impl",
135    srcs: [":mesa_vulkan_xml"],
136    out: ["vk_physical_device_features.c"],
137    tools: ["vk_physical_device_features_gen"],
138    cmd: "python3 $(location vk_physical_device_features_gen) --xml " +
139        "$(location :mesa_vulkan_xml) --out-h " +
140        "$(genDir)/vk_physical_device_features.h --out-c " +
141        "$(location vk_physical_device_features.c) --beta false",
142}
143
144genrule {
145    name: "vk_physical_device_properties_header",
146    srcs: [":mesa_vulkan_xml"],
147    out: ["vk_physical_device_properties.h"],
148    tools: ["vk_physical_device_properties_gen"],
149    cmd: "python3 $(location vk_physical_device_properties_gen) --xml " +
150        "$(location :mesa_vulkan_xml) --out-h " +
151        "$(location vk_physical_device_properties.h) --out-c " +
152        "$(genDir)/placeholder.c --beta false",
153}
154
155genrule {
156    name: "vk_physical_device_properties_impl",
157    srcs: [":mesa_vulkan_xml"],
158    out: ["vk_physical_device_properties.c"],
159    tools: ["vk_physical_device_properties_gen"],
160    cmd: "python3 $(location vk_physical_device_properties_gen) --xml " +
161        "$(location :mesa_vulkan_xml) --out-h " +
162        "$(genDir)/vk_physical_device_properties.h --out-c " +
163        "$(location vk_physical_device_properties.c) --beta false",
164}
165
166genrule {
167    name: "vk_format_info_header",
168    srcs: [":mesa_vulkan_xml"],
169    out: ["vk_format_info.h"],
170    tools: ["vk_format_info_gen"],
171    cmd: "python3 $(location vk_format_info_gen) --xml " +
172        "$(location :mesa_vulkan_xml) --out-h " +
173        "$(location vk_format_info.h) --out-c " +
174        "$(genDir)/placeholder.c",
175}
176
177genrule {
178    name: "vk_format_info_impl",
179    srcs: [":mesa_vulkan_xml"],
180    out: ["vk_format_info.c"],
181    tools: ["vk_format_info_gen"],
182    cmd: "python3 $(location vk_format_info_gen) --xml " +
183        "$(location :mesa_vulkan_xml) --out-h " +
184        "$(genDir)/vk_format_info.h --out-c " +
185        "$(location vk_format_info.c)",
186}
187
188genrule {
189    name: "vk_physical_device_spirv_caps_impl",
190    srcs: [":mesa_vulkan_xml"],
191    out: ["vk_physical_device_spirv_caps.c"],
192    tools: ["vk_physical_device_spirv_caps_gen"],
193    cmd: "python3 $(location vk_physical_device_spirv_caps_gen) --xml " +
194        "$(location :mesa_vulkan_xml) --out-c $(location vk_physical_device_spirv_caps.c) " +
195        "--beta false",
196}
197
198genrule {
199    name: "vk_synchronization_helpers_impl",
200    srcs: [":mesa_vulkan_xml"],
201    out: ["vk_synchronization_helpers.c"],
202    tools: ["vk_synchronization_helpers_gen"],
203    cmd: "python3 $(location vk_synchronization_helpers_gen) --xml " +
204        "$(location :mesa_vulkan_xml) --out-c $(location vk_synchronization_helpers.c) " +
205        "--beta false",
206}
207
208cc_library_static {
209    name: "mesa_vulkan_runtime",
210    vendor: true,
211    host_supported: true,
212    defaults: [
213        "mesa_common_defaults",
214    ],
215    header_libs: [
216        "mesa_common_headers",
217        "mesa_nir_headers",
218        "mesa_compiler_headers",
219        "mesa_radix_sort_headers",
220    ],
221    static_libs: [
222        "libarect",
223        "mesa_util",
224        "mesa_vulkan_util",
225        "mesa_util_c11",
226        "mesa_util_format",
227        "mesa_compiler",
228    ],
229    generated_headers: [
230        "vk_cmd_queue_header",
231        "vk_common_entrypoints_header",
232        "vk_cmd_enqueue_entrypoints_header",
233        "vk_dispatch_trampolines_header",
234        "vk_physical_device_features_header",
235        "vk_physical_device_properties_header",
236        "vk_format_info_header",
237        "nir_builder_opcodes_header",
238        "nir_intrinsics_header",
239        "nir_intrinsics_indices_header",
240        "nir_opcodes_header",
241        "u_format_gen_header",
242        "spirv_info_header",
243        "builtin_types_header",
244    ],
245    generated_sources: [
246        "vk_cmd_queue_impl",
247        "vk_common_entrypoints_impl",
248        "vk_cmd_enqueue_entrypoints_impl",
249        "vk_dispatch_trampolines_impl",
250        "vk_physical_device_features_impl",
251        "vk_physical_device_properties_impl",
252        "vk_format_info_impl",
253        "vk_physical_device_spirv_caps_impl",
254        "vk_synchronization_helpers_impl",
255    ],
256    srcs: [
257        "rmv/vk_rmv_common.c",
258        "rmv/vk_rmv_exporter.c",
259        "vk_acceleration_structure.c",
260        "vk_blend.c",
261        "vk_buffer.c",
262        "vk_buffer_view.c",
263        "vk_cmd_copy.c",
264        "vk_cmd_enqueue.c",
265        "vk_command_buffer.c",
266        "vk_command_pool.c",
267        "vk_debug_report.c",
268        "vk_debug_utils.c",
269        "vk_deferred_operation.c",
270        "vk_descriptor_set_layout.c",
271        "vk_descriptors.c",
272        "vk_descriptor_update_template.c",
273        "vk_device.c",
274        "vk_device_memory.c",
275        "vk_device_generated_commands.c",
276        "vk_fence.c",
277        "vk_framebuffer.c",
278        "vk_image.c",
279        "vk_instance.c",
280        "vk_log.c",
281        "vk_object.c",
282        "vk_meta.c",
283        "vk_meta_draw_rects.c",
284        "vk_meta_object_list.c",
285        "vk_nir.c",
286        "vk_nir_convert_ycbcr.c",
287        "vk_physical_device.c",
288        "vk_pipeline.c",
289        "vk_pipeline_layout.c",
290        "vk_pipeline_cache.c",
291        "vk_query_pool.c",
292        "vk_queue.c",
293        "vk_render_pass.c",
294        "vk_sampler.c",
295        "vk_semaphore.c",
296        "vk_shader.c",
297        "vk_standard_sample_locations.c",
298        "vk_sync.c",
299        "vk_sync_binary.c",
300        "vk_sync_dummy.c",
301        "vk_sync_timeline.c",
302        "vk_video.c",
303        "vk_ycbcr_conversion.c",
304        "vk_graphics_state.c",
305        "vk_synchronization.c",
306        "vk_shader_module.c",
307        ":mesa_radix_sort_impl",
308    ],
309    export_include_dirs: [
310        ".",
311    ],
312    target: {
313        android: {
314            srcs: select(soong_config_variable("gfxstream", "mesa3d_platforms"), {
315                "none": [],
316                default: [
317                    "vk_android.c",
318                ],
319            }),
320            static_libs: [
321                "mesa_u_gralloc",
322            ],
323            shared_libs: [
324                "libnativewindow",
325                "libsync",
326                "libcutils",
327            ],
328            header_libs: [
329                "hwvulkan_headers",
330                "libnativewindow_headers",
331            ],
332        },
333    },
334}
335