blob: b8ba591173044f993f74fb26bd69adf8b7dd0c95 [file] [log] [blame]
# Copyright 2023 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")
mesa_python_action("lvp_entrypoints") {
outputs = [
"$target_gen_dir/lvp_entrypoints.h",
"$target_gen_dir/lvp_entrypoints.c",
]
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",
]
args = [
"--xml",
rebase_path("$mesa_build_root", root_build_dir) +
"/src/vulkan/registry/vk.xml",
"--proto",
"--weak",
"--out-h",
rebase_path("$target_gen_dir/lvp_entrypoints.h", root_build_dir),
"--out-c",
rebase_path("$target_gen_dir/lvp_entrypoints.c", root_build_dir),
"--prefix",
"lvp",
]
}
config("lavapipe_config") {
include_dirs = [
"$root_gen_dir/third_party/mesa/src/compiler/nir/",
"$root_gen_dir/third_party/mesa/src/gallium/frontends/lavapipe/",
"$root_gen_dir/third_party/mesa/src/vulkan/runtime/",
"$root_gen_dir/third_party/mesa/src/vulkan/util/",
"$mesa_build_root/include/",
"$mesa_build_root/src/compiler/",
"$mesa_build_root/src/compiler/nir/",
"$mesa_build_root/src/gallium/auxiliary/",
"$mesa_build_root/src/gallium/drivers/",
"$mesa_build_root/src/gallium/include/",
"$mesa_build_root/src/gallium/winsys/",
"$mesa_build_root/src/util/",
"$mesa_build_root/src/",
"$mesa_build_root/src/vulkan/util/",
]
defines = [
# Unnecessary because we hardcode GALLIUM_STATIC_TARGETS=1.
"PIPE_SEARCH_DIR=\"UNNECESSARY\"",
# TODO(b/321122796): otherwise get "use of undeclared identifier 'NULL'" in u_dl.c etc.
# Is there some better way to define this? If we do decide to define NULL (vs e.g. adding
# a header include), is this the best place? Probably, since this is closest to where it's
# needed.
"NULL=0",
# So that sw_screen_create_vk() is customized to use lavapipe.
"GALLIUM_LLVMPIPE",
]
# Suppress warnings.
configs = [
"//build/config:Wno-unused-but-set-variable",
"//build/config:Wno-strict-prototypes",
"//third_party/mesa:LLVMHeader_config",
]
}
mesa_source_set("lavapipe") {
public_deps = [
"$mesa_build_root/src/compiler",
]
public_configs = [ ":lavapipe_config" ]
deps = [
":lvp_entrypoints",
"$mesa_build_root/src:sha1",
"$mesa_build_root/src/compiler/nir",
"$mesa_build_root/src/gallium/auxiliary",
"$mesa_build_root/src/gallium/auxiliary/pipe-loader:pipe-loader-llvmpipe",
"$mesa_build_root/src/util",
"$mesa_build_root/src/vulkan/util",
]
if(target_os == "fuchsia") {
public_deps += [ "$mesa_build_root/src/vulkan/wsi:stub" ]
deps += [ "$mesa_build_root/src/vulkan/runtime:zircon" ]
} else {
public_deps += [ "$mesa_build_root/src/vulkan/wsi" ]
deps += [ "$mesa_build_root/src/vulkan/runtime" ]
}
sources = [
# target.c is not used by our sibling meson.build, but rather by
# //mesa/src/gallium/targets/lavapipe/meson.build. We include it here because it's not worth
# creating another BUILD.gn for a single file.
"$mesa_build_root/src/gallium/targets/lavapipe/target.c",
"$target_gen_dir/lvp_entrypoints.c",
"$target_gen_dir/lvp_entrypoints.h",
"lvp_cmd_buffer.c",
"lvp_descriptor_set.c",
"lvp_device.c",
"lvp_execute.c",
"lvp_formats.c",
"lvp_fuchsia.c",
"lvp_fuchsia_magma_stubs.c",
"lvp_fuchsia_memory.c",
"lvp_image.c",
"lvp_inline_uniforms.c",
"lvp_lower_input_attachments.c",
"lvp_lower_vulkan_resource.c",
"lvp_lower_vulkan_resource.h",
"lvp_pipe_sync.c",
"lvp_pipeline.c",
"lvp_pipeline_cache.c",
"lvp_query.c",
"lvp_util.c",
"lvp_wsi.c",
]
}