blob: 76430bc877aea4e3d8a694bdd9b7a8df04e772f4 [file] [log] [blame]
# Copyright 2022 Google, LLC
#
# 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 (including the next
# paragraph) 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.
import("../../../mesa.gni")
src_dir = "$mesa_source_root/src/vulkan/runtime"
config("common") {
include_dirs = [
"$target_gen_dir",
# Needed because generated vk_dispatch_trampolines.h includes 'vulkan/util/vk_dispatch_table.h'
"$target_gen_dir/../..",
src_dir,
"$mesa_source_root/src/vulkan",
"$mesa_source_root/src/vulkan/util",
"$mesa_source_root/include",
]
}
config("magma_config") {
configs = [ ":common" ]
defines = [ "USE_MAGMA=1" ]
}
runtime_headers = [
"$src_dir/vk_acceleration_structure.h",
"$src_dir/vk_blend.h",
"$src_dir/vk_buffer.h",
"$src_dir/vk_buffer_view.h",
"$src_dir/vk_command_buffer.h",
"$src_dir/vk_command_pool.h",
"$src_dir/vk_debug_report.h",
"$src_dir/vk_debug_utils.h",
"$src_dir/vk_deferred_operation.h",
"$src_dir/vk_descriptor_set_layout.h",
"$src_dir/vk_descriptor_update_template.h",
"$src_dir/vk_descriptors.h",
"$src_dir/vk_device.h",
"$src_dir/vk_device_generated_commands.h",
"$src_dir/vk_fence.h",
"$src_dir/vk_framebuffer.h",
"$src_dir/vk_graphics_state.h",
"$src_dir/vk_image.h",
"$src_dir/vk_instance.h",
"$src_dir/vk_log.h",
"$src_dir/vk_meta.h",
"$src_dir/vk_meta_object_list.h",
"$src_dir/vk_nir.h",
"$src_dir/vk_nir_convert_ycbcr.h",
"$src_dir/vk_object.h",
"$src_dir/vk_physical_device.h",
"$src_dir/vk_pipeline.h",
"$src_dir/vk_pipeline_cache.h",
"$src_dir/vk_pipeline_layout.h",
"$src_dir/vk_queue.h",
"$src_dir/vk_sampler.h",
"$src_dir/vk_semaphore.h",
"$src_dir/vk_shader.h",
"$src_dir/vk_shader_module.h",
"$src_dir/vk_standard_sample_locations.h",
"$src_dir/vk_sync.h",
"$src_dir/vk_sync_binary.h",
"$src_dir/vk_sync_dummy.h",
"$src_dir/vk_sync_timeline.h",
"$src_dir/rmv/vk_rmv_common.h",
"$src_dir/rmv/vk_rmv_exporter.h",
"$src_dir/radix_sort/common/vk/barrier.h",
"$src_dir/radix_sort/common/macros.h",
"$src_dir/radix_sort/common/util.h",
"$src_dir/radix_sort/shaders/push.h",
"$src_dir/radix_sort/radix_sort_u64.h",
"$src_dir/radix_sort/radix_sort_devaddr.h",
"$src_dir/radix_sort/radix_sort_vk_ext.h",
"$src_dir/radix_sort/radix_sort_vk.h",
"$src_dir/radix_sort/target.h",
]
runtime_sources = [
"$src_dir/rmv/vk_rmv_common.c",
"$src_dir/rmv/vk_rmv_exporter.c",
"$src_dir/vk_blend.c",
"$src_dir/vk_buffer.c",
"$src_dir/vk_buffer_view.c",
"$src_dir/vk_cmd_copy.c",
"$src_dir/vk_cmd_enqueue.c",
"$src_dir/vk_command_buffer.c",
"$src_dir/vk_command_pool.c",
"$src_dir/vk_debug_report.c",
"$src_dir/vk_debug_utils.c",
"$src_dir/vk_deferred_operation.c",
"$src_dir/vk_descriptor_set_layout.c",
"$src_dir/vk_descriptor_update_template.c",
"$src_dir/vk_descriptors.c",
"$src_dir/vk_device.c",
"$src_dir/vk_device_generated_commands.c",
"$src_dir/vk_fence.c",
"$src_dir/vk_framebuffer.c",
"$src_dir/vk_graphics_state.c",
"$src_dir/vk_image.c",
"$src_dir/vk_instance.c",
"$src_dir/vk_log.c",
"$src_dir/vk_meta.c",
"$src_dir/vk_meta_draw_rects.c",
"$src_dir/vk_meta_object_list.c",
"$src_dir/vk_nir.c",
"$src_dir/vk_nir_convert_ycbcr.c",
"$src_dir/vk_object.c",
"$src_dir/vk_object.h",
"$src_dir/vk_physical_device.c",
"$src_dir/vk_pipeline.c",
"$src_dir/vk_pipeline_cache.c",
"$src_dir/vk_pipeline_layout.c",
"$src_dir/vk_queue.c",
"$src_dir/vk_render_pass.c",
"$src_dir/vk_sampler.c",
"$src_dir/vk_semaphore.c",
"$src_dir/vk_shader.c",
"$src_dir/vk_shader_module.c",
"$src_dir/vk_standard_sample_locations.c",
"$src_dir/vk_sync.c",
"$src_dir/vk_sync_binary.c",
"$src_dir/vk_sync_dummy.c",
"$src_dir/vk_sync_timeline.c",
"$src_dir/vk_synchronization.c",
"$src_dir/vk_ycbcr_conversion.c",
]
runtime_public_deps = [
"$mesa_build_root/include:c_compat",
"$mesa_build_root/include:vulkan",
]
mesa_source_set("generated") {
public_deps = [
":vk_cmd_enqueue_entrypoints",
":vk_cmd_queue",
":vk_common_entrypoints",
":vk_dispatch_trampolines",
":vk_format_info",
":vk_physical_device_features",
":vk_physical_device_properties",
":vk_physical_device_spirv_caps",
"$mesa_build_root/src/compiler/nir",
"$mesa_build_root/src/util",
"$mesa_build_root/src/vulkan/util",
]
}
group("zircon") {
public_deps = [ ":runtime" ]
}
mesa_source_set("runtime") {
public_configs = [ ":common" ]
public_deps = [ ":generated" ] + runtime_public_deps
sources = [
"$target_gen_dir/vk_cmd_enqueue_entrypoints.c",
"$target_gen_dir/vk_cmd_queue.c",
"$target_gen_dir/vk_common_entrypoints.c",
"$target_gen_dir/vk_dispatch_trampolines.c",
"$target_gen_dir/vk_physical_device_features.c",
"$target_gen_dir/vk_physical_device_properties.c",
"$target_gen_dir/vk_physical_device_spirv_caps.c",
] + runtime_sources + runtime_headers
configs = [ "//build/config:Wno-strict-prototypes" ]
}
mesa_python_action("vk_cmd_queue") {
outputs = [
"$target_gen_dir/vk_cmd_queue.h",
"$target_gen_dir/vk_cmd_queue.c",
]
script = "$mesa_source_root/src/vulkan/util/vk_cmd_queue_gen.py"
inputs = [
"$mesa_source_root/src/vulkan/util/vk_dispatch_table_gen.py",
"$mesa_source_root/src/vulkan/util/vk_extensions.py",
"$mesa_source_root/src/vulkan/util/vk_entrypoints.py",
"$mesa_source_root/src/vulkan/registry/vk.xml",
]
args = [
"--beta",
"false",
"--xml",
rebase_path("$mesa_source_root", root_build_dir) +
"/src/vulkan/registry/vk.xml",
"--out-h",
rebase_path("$target_gen_dir/vk_cmd_queue.h", root_build_dir),
"--out-c",
rebase_path("$target_gen_dir/vk_cmd_queue.c", root_build_dir),
]
}
mesa_python_action("vk_common_entrypoints") {
h_file = "$target_gen_dir/vk_common_entrypoints.h"
c_file = "$target_gen_dir/vk_common_entrypoints.c"
outputs = [
h_file,
c_file,
]
script = "$mesa_source_root/src/vulkan/util/vk_entrypoints_gen.py"
inputs = [
"$mesa_source_root/src/vulkan/util/vk_dispatch_table_gen.py",
"$mesa_source_root/src/vulkan/util/vk_extensions.py",
"$mesa_source_root/src/vulkan/util/vk_entrypoints.py",
"$mesa_source_root/src/vulkan/registry/vk.xml",
]
args = [
"--beta",
"false",
"--xml",
rebase_path("$mesa_source_root", root_build_dir) +
"/src/vulkan/registry/vk.xml",
"--proto",
"--weak",
"--out-h",
rebase_path(h_file, root_build_dir),
"--out-c",
rebase_path(c_file, root_build_dir),
"--prefix",
"vk_common",
]
}
mesa_python_action("vk_cmd_enqueue_entrypoints") {
h_file = "$target_gen_dir/vk_cmd_enqueue_entrypoints.h"
c_file = "$target_gen_dir/vk_cmd_enqueue_entrypoints.c"
outputs = [
h_file,
c_file,
]
script = "$mesa_source_root/src/vulkan/util/vk_entrypoints_gen.py"
inputs = [
"$mesa_source_root/src/vulkan/util/vk_dispatch_table_gen.py",
"$mesa_source_root/src/vulkan/util/vk_extensions.py",
"$mesa_source_root/src/vulkan/util/vk_entrypoints.py",
"$mesa_source_root/src/vulkan/registry/vk.xml",
]
args = [
"--beta",
"false",
"--xml",
rebase_path("$mesa_source_root", root_build_dir) +
"/src/vulkan/registry/vk.xml",
"--proto",
"--weak",
"--out-h",
rebase_path(h_file, root_build_dir),
"--out-c",
rebase_path(c_file, root_build_dir),
"--prefix",
"vk_cmd_enqueue",
"--prefix",
"vk_cmd_enqueue_unless_primary",
]
}
mesa_python_action("vk_dispatch_trampolines") {
h_file = "$target_gen_dir/vk_dispatch_trampolines.h"
c_file = "$target_gen_dir/vk_dispatch_trampolines.c"
outputs = [
h_file,
c_file,
]
script = "$mesa_source_root/src/vulkan/util/vk_dispatch_trampolines_gen.py"
inputs = [
"$mesa_source_root/src/vulkan/util/vk_dispatch_table_gen.py",
"$mesa_source_root/src/vulkan/util/vk_extensions.py",
"$mesa_source_root/src/vulkan/util/vk_entrypoints.py",
"$mesa_source_root/src/vulkan/registry/vk.xml",
]
args = [
"--beta",
"false",
"--xml",
rebase_path("$mesa_source_root", root_build_dir) +
"/src/vulkan/registry/vk.xml",
"--out-h",
rebase_path(h_file, root_build_dir),
"--out-c",
rebase_path(c_file, root_build_dir),
]
}
mesa_python_action("vk_physical_device_features") {
c_file = "$target_gen_dir/vk_physical_device_features.c"
h_file = "$target_gen_dir/vk_physical_device_features.h"
outputs = [
c_file,
h_file,
]
script =
"$mesa_source_root/src/vulkan/util/vk_physical_device_features_gen.py"
inputs = [
"$mesa_source_root/src/vulkan/registry/vk.xml",
"$mesa_source_root/src/vulkan/util/vk_extensions.py",
]
args = [
"--beta",
"false",
"--xml",
rebase_path("$mesa_source_root", root_build_dir) +
"/src/vulkan/registry/vk.xml",
"--out-c",
rebase_path(c_file, root_build_dir),
"--out-h",
rebase_path(h_file, root_build_dir),
]
}
mesa_python_action("vk_physical_device_properties") {
script =
"$mesa_source_root/src/vulkan/util/vk_physical_device_properties_gen.py"
inputs = [
"$mesa_source_root/src/vulkan/registry/vk.xml",
"$mesa_source_root/src/vulkan/util/vk_extensions.py",
]
outputs = [
"$target_gen_dir/vk_physical_device_properties.c",
"$target_gen_dir/vk_physical_device_properties.h",
]
args = [
"--xml",
rebase_path(inputs[0], root_build_dir),
"--out-c",
rebase_path(outputs[0], root_build_dir),
"--out-h",
rebase_path(outputs[1], root_build_dir),
"--beta",
"false",
]
}
mesa_python_action("vk_format_info") {
script = "$src_dir/vk_format_info_gen.py"
inputs = [ "$mesa_source_root/src/vulkan/registry/vk.xml" ]
outputs = [
"$target_gen_dir/vk_format_info.c",
"$target_gen_dir/vk_format_info.h",
]
args = [
"--xml",
rebase_path(inputs[0], root_build_dir),
"--out-c",
rebase_path(outputs[0], root_build_dir),
"--out-h",
rebase_path(outputs[1], root_build_dir),
]
}
mesa_python_action("vk_physical_device_spirv_caps") {
script =
"$mesa_source_root/src/vulkan/util/vk_physical_device_spirv_caps_gen.py"
inputs = [
"$mesa_source_root/src/vulkan/registry/vk.xml",
"$mesa_source_root/src/vulkan/util/vk_extensions.py",
"$mesa_source_root/src/vulkan/util/vk_physical_device_features_gen.py",
]
outputs = [ "$target_gen_dir/vk_physical_device_spirv_caps.c" ]
args = [
"--xml",
rebase_path(inputs[0], root_build_dir),
"--out-c",
rebase_path(outputs[0], root_build_dir),
"--beta",
"false",
]
}