/* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package { // See: http://go/android-license-faq default_applicable_licenses: ["external_mesa3d_license"], } python_binary_host { name: "vk_format_info_gen", main: "vk_format_info_gen.py", srcs: ["vk_format_info_gen.py"], libs: [ "mako", ], } genrule { name: "vk_cmd_queue_header", srcs: [":mesa_vulkan_xml"], out: ["vk_cmd_queue.h"], tools: ["vk_cmd_queue_gen"], cmd: "python3 $(location vk_cmd_queue_gen) --xml " + "$(location :mesa_vulkan_xml) --out-h " + "$(location vk_cmd_queue.h) --out-c " + "$(genDir)/placeholder.c --beta false", } genrule { name: "vk_cmd_queue_impl", srcs: [":mesa_vulkan_xml"], out: ["vk_cmd_queue.c"], tools: ["vk_cmd_queue_gen"], cmd: "python3 $(location vk_cmd_queue_gen) --xml " + "$(location :mesa_vulkan_xml) --out-c " + "$(location vk_cmd_queue.c) --out-h " + "$(genDir)/vk_cmd_queue.h --beta false", } genrule { name: "vk_common_entrypoints_header", srcs: [":mesa_vulkan_xml"], out: ["vk_common_entrypoints.h"], tools: ["vk_entrypoints_gen"], cmd: "python3 $(location vk_entrypoints_gen) --xml " + "$(location :mesa_vulkan_xml) --proto --weak --out-h " + "$(location vk_common_entrypoints.h) --out-c " + "$(genDir)/placeholder.c --prefix vk_common --beta false", } genrule { name: "vk_common_entrypoints_impl", srcs: [":mesa_vulkan_xml"], out: ["vk_common_entrypoints.c"], tools: ["vk_entrypoints_gen"], cmd: "python3 $(location vk_entrypoints_gen) --xml " + "$(location :mesa_vulkan_xml) --proto --weak --out-h " + "$(genDir)/vk_common_entrypoints.h --out-c " + "$(location vk_common_entrypoints.c) --prefix vk_common " + "--beta false", } genrule { name: "vk_cmd_enqueue_entrypoints_header", srcs: [":mesa_vulkan_xml"], out: ["vk_cmd_enqueue_entrypoints.h"], tools: ["vk_entrypoints_gen"], cmd: "python3 $(location vk_entrypoints_gen) --xml " + "$(location :mesa_vulkan_xml) --proto --weak --out-h " + "$(location vk_cmd_enqueue_entrypoints.h) --out-c " + "$(genDir)/placeholder.c --prefix vk_cmd_enqueue " + " --prefix vk_cmd_enqueue_unless_primary --beta false", } genrule { name: "vk_cmd_enqueue_entrypoints_impl", srcs: [":mesa_vulkan_xml"], out: ["vk_cmd_enqueue_entrypoints.c"], tools: ["vk_entrypoints_gen"], cmd: "python3 $(location vk_entrypoints_gen) --xml " + "$(location :mesa_vulkan_xml) --proto --weak --out-h " + "$(genDir)/vk_cmd_enqueue_entrypoints.h --out-c " + "$(location vk_cmd_enqueue_entrypoints.c) --prefix vk_cmd_enqueue " + "--prefix vk_cmd_enqueue_unless_primary --beta false", } genrule { name: "vk_dispatch_trampolines_header", srcs: [":mesa_vulkan_xml"], out: ["vk_dispatch_trampolines.h"], tools: ["vk_dispatch_trampolines_gen"], cmd: "python3 $(location vk_dispatch_trampolines_gen) --xml " + "$(location :mesa_vulkan_xml) --out-h " + "$(location vk_dispatch_trampolines.h) --out-c " + "$(genDir)/placeholder.c --beta false", } genrule { name: "vk_dispatch_trampolines_impl", srcs: [":mesa_vulkan_xml"], out: ["vk_dispatch_trampolines.c"], tools: ["vk_dispatch_trampolines_gen"], cmd: "python3 $(location vk_dispatch_trampolines_gen) --xml " + "$(location :mesa_vulkan_xml) --out-h " + "$(genDir)/vk_dispatch_trampolines.h --out-c " + "$(location vk_dispatch_trampolines.c) --beta false", } genrule { name: "vk_physical_device_features_header", srcs: [":mesa_vulkan_xml"], out: ["vk_physical_device_features.h"], tools: ["vk_physical_device_features_gen"], cmd: "python3 $(location vk_physical_device_features_gen) --xml " + "$(location :mesa_vulkan_xml) --out-h " + "$(location vk_physical_device_features.h) --out-c " + "$(genDir)/placeholder.c --beta false", } genrule { name: "vk_physical_device_features_impl", srcs: [":mesa_vulkan_xml"], out: ["vk_physical_device_features.c"], tools: ["vk_physical_device_features_gen"], cmd: "python3 $(location vk_physical_device_features_gen) --xml " + "$(location :mesa_vulkan_xml) --out-h " + "$(genDir)/vk_physical_device_features.h --out-c " + "$(location vk_physical_device_features.c) --beta false", } genrule { name: "vk_physical_device_properties_header", srcs: [":mesa_vulkan_xml"], out: ["vk_physical_device_properties.h"], tools: ["vk_physical_device_properties_gen"], cmd: "python3 $(location vk_physical_device_properties_gen) --xml " + "$(location :mesa_vulkan_xml) --out-h " + "$(location vk_physical_device_properties.h) --out-c " + "$(genDir)/placeholder.c --beta false", } genrule { name: "vk_physical_device_properties_impl", srcs: [":mesa_vulkan_xml"], out: ["vk_physical_device_properties.c"], tools: ["vk_physical_device_properties_gen"], cmd: "python3 $(location vk_physical_device_properties_gen) --xml " + "$(location :mesa_vulkan_xml) --out-h " + "$(genDir)/vk_physical_device_properties.h --out-c " + "$(location vk_physical_device_properties.c) --beta false", } genrule { name: "vk_format_info_header", srcs: [":mesa_vulkan_xml"], out: ["vk_format_info.h"], tools: ["vk_format_info_gen"], cmd: "python3 $(location vk_format_info_gen) --xml " + "$(location :mesa_vulkan_xml) --out-h " + "$(location vk_format_info.h) --out-c " + "$(genDir)/placeholder.c", } genrule { name: "vk_format_info_impl", srcs: [":mesa_vulkan_xml"], out: ["vk_format_info.c"], tools: ["vk_format_info_gen"], cmd: "python3 $(location vk_format_info_gen) --xml " + "$(location :mesa_vulkan_xml) --out-h " + "$(genDir)/vk_format_info.h --out-c " + "$(location vk_format_info.c)", } cc_library_static { name: "mesa_vulkan_runtime", vendor: true, host_supported: true, defaults: [ "mesa_common_defaults", ], header_libs: [ "mesa_common_headers", "mesa_nir_headers", "mesa_compiler_headers", ], static_libs: [ "libarect", "mesa_util", "mesa_vulkan_util", "mesa_util_c11", "mesa_util_format", "mesa_compiler", ], generated_headers: [ "vk_cmd_queue_header", "vk_common_entrypoints_header", "vk_cmd_enqueue_entrypoints_header", "vk_dispatch_trampolines_header", "vk_physical_device_features_header", "vk_physical_device_properties_header", "vk_format_info_header", "nir_builder_opcodes_header", "nir_intrinsics_header", "nir_intrinsics_indices_header", "nir_opcodes_header", "u_format_gen_header", "spirv_info_header", "builtin_types_header", ], generated_sources: [ "vk_cmd_queue_impl", "vk_common_entrypoints_impl", "vk_cmd_enqueue_entrypoints_impl", "vk_dispatch_trampolines_impl", "vk_physical_device_features_impl", "vk_physical_device_properties_impl", "vk_format_info_impl", ], srcs: [ "rmv/vk_rmv_common.c", "rmv/vk_rmv_exporter.c", "vk_acceleration_structure.c", "vk_blend.c", "vk_buffer.c", "vk_buffer_view.c", "vk_cmd_copy.c", "vk_cmd_enqueue.c", "vk_command_buffer.c", "vk_command_pool.c", "vk_debug_report.c", "vk_debug_utils.c", "vk_deferred_operation.c", "vk_descriptor_set_layout.c", "vk_descriptors.c", "vk_descriptor_update_template.c", "vk_device.c", "vk_device_memory.c", "vk_fence.c", "vk_framebuffer.c", "vk_image.c", "vk_instance.c", "vk_log.c", "vk_object.c", "vk_meta.c", "vk_meta_object_list.c", "vk_physical_device.c", "vk_pipeline_layout.c", "vk_query_pool.c", "vk_queue.c", "vk_render_pass.c", "vk_sampler.c", "vk_semaphore.c", "vk_standard_sample_locations.c", "vk_sync.c", "vk_sync_binary.c", "vk_sync_dummy.c", "vk_sync_timeline.c", "vk_video.c", "vk_ycbcr_conversion.c", "vk_graphics_state.c", ], export_include_dirs: [ ".", ], target: { android: { srcs: select(soong_config_variable("gfxstream", "mesa3d_platforms"), { "none": [], default: [ "vk_android.c", ], }), static_libs: [ "mesa_u_gralloc", ], shared_libs: [ "libnativewindow", "libsync", "libcutils", ], header_libs: [ "hwvulkan_headers", "libnativewindow_headers", ], }, }, }