blob: 306ab8b098cf43fef77f1cfa9cbdc07872d32b17 [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("//third_party/mako/py_srcs.gni")
import("../../../mesa.gni")
config("config") {
include_dirs = [
"$target_gen_dir",
".",
]
defines = [ "USE_MAGMA=1" ]
}
mesa_source_set("runtime") {
public_configs = [ ":config" ]
public_deps = [
"$mesa_build_root/include:vulkan",
"$mesa_build_root/include:c_compat",
"$magma_build_root/include:magma",
]
deps = [
":vk_cmd_queue",
":vk_common_entrypoints",
":vk_cmd_enqueue_entrypoints",
":vk_dispatch_trampolines",
":vk_physical_device_features",
"$magma_build_root/include:magma",
"$mesa_build_root/src/util",
"$mesa_build_root/src/vulkan/util",
"$mesa_build_root/src/compiler/nir",
]
include_dirs = [
# Needed because generated vk_dispatch_trampolines.h includes 'vulkan/util/vk_dispatch_table.h'
"$target_gen_dir/../..",
]
sources = [
"vk_buffer.c",
"vk_buffer.h",
"vk_cmd_copy.c",
"vk_cmd_enqueue.c",
"vk_command_buffer.c",
"vk_command_buffer.h",
"vk_command_pool.c",
"vk_command_pool.h",
"vk_debug_report.c",
"vk_debug_report.h",
"vk_debug_utils.c",
"vk_debug_utils.h",
"vk_deferred_operation.c",
"vk_deferred_operation.h",
"vk_descriptors.c",
"vk_descriptors.h",
"vk_device.c",
"vk_device.h",
"vk_fence.c",
"vk_fence.h",
"vk_framebuffer.c",
"vk_framebuffer.h",
"vk_graphics_state.c",
"vk_graphics_state.h",
"vk_image.c",
"vk_image.h",
"vk_instance.c",
"vk_instance.h",
"vk_log.c",
"vk_log.h",
"vk_magma_syncobj.c",
"vk_magma_syncobj.h",
"vk_nir.c",
"vk_nir.h",
"vk_object.c",
"vk_object.h",
"vk_physical_device.c",
"vk_physical_device.h",
"vk_pipeline.c",
"vk_pipeline.h",
"vk_pipeline_cache.c",
"vk_pipeline_cache.h",
"vk_queue.c",
"vk_queue.h",
"vk_render_pass.c",
"vk_semaphore.c",
"vk_semaphore.h",
"vk_shader_module.c",
"vk_shader_module.h",
"vk_standard_sample_locations.c",
"vk_standard_sample_locations.h",
"vk_sync.c",
"vk_sync.h",
"vk_sync_binary.c",
"vk_sync_binary.h",
"vk_sync_dummy.c",
"vk_sync_dummy.h",
"vk_sync_timeline.c",
"vk_sync_timeline.h",
"vk_synchronization2.c",
"$target_gen_dir/vk_cmd_queue.h",
"$target_gen_dir/vk_cmd_queue.c",
"$target_gen_dir/vk_common_entrypoints.h",
"$target_gen_dir/vk_common_entrypoints.c",
"$target_gen_dir/vk_cmd_enqueue_entrypoints.h",
"$target_gen_dir/vk_cmd_enqueue_entrypoints.c",
"$target_gen_dir/vk_dispatch_trampolines.h",
"$target_gen_dir/vk_dispatch_trampolines.c",
"$target_gen_dir/vk_physical_device_features.c",
]
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_build_root/src/vulkan/util/vk_cmd_queue_gen.py"
inputs = [
"$mesa_build_root/src/vulkan/util/vk_dispatch_table_gen.py",
"$mesa_build_root/src/vulkan/util/vk_extensions.py",
"$mesa_build_root/src/vulkan/util/vk_entrypoints.py",
"$mesa_build_root/src/vulkan/registry/vk.xml",
] + third_party_mako_srcs
args = [
"--xml",
rebase_path("$mesa_build_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_build_root/src/vulkan/util/vk_entrypoints_gen.py"
inputs = [
"$mesa_build_root/src/vulkan/util/vk_dispatch_table_gen.py",
"$mesa_build_root/src/vulkan/util/vk_extensions.py",
"$mesa_build_root/src/vulkan/util/vk_entrypoints.py",
"$mesa_build_root/src/vulkan/registry/vk.xml",
] + third_party_mako_srcs
args = [
"--xml",
rebase_path("$mesa_build_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_build_root/src/vulkan/util/vk_entrypoints_gen.py"
inputs = [
"$mesa_build_root/src/vulkan/util/vk_dispatch_table_gen.py",
"$mesa_build_root/src/vulkan/util/vk_extensions.py",
"$mesa_build_root/src/vulkan/util/vk_entrypoints.py",
"$mesa_build_root/src/vulkan/registry/vk.xml",
] + third_party_mako_srcs
args = [
"--xml",
rebase_path("$mesa_build_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_build_root/src/vulkan/util/vk_dispatch_trampolines_gen.py"
inputs = [
"$mesa_build_root/src/vulkan/util/vk_dispatch_table_gen.py",
"$mesa_build_root/src/vulkan/util/vk_extensions.py",
"$mesa_build_root/src/vulkan/util/vk_entrypoints.py",
"$mesa_build_root/src/vulkan/registry/vk.xml",
] + third_party_mako_srcs
args = [
"--xml",
rebase_path("$mesa_build_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"
outputs = [ c_file ]
script = "$mesa_build_root/src/vulkan/runtime/vk_physical_device_features.py"
inputs = [
"$mesa_build_root/src/vulkan/registry/vk.xml",
] + third_party_mako_srcs
args = [
"--xml",
rebase_path("$mesa_build_root", root_build_dir) + "/src/vulkan/registry/vk.xml",
"--out-c",
rebase_path(c_file, root_build_dir),
]
}