blob: 235f0997aa46fbb6b09724c55306dde69275c4ca [file] [log] [blame]
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Define targets used to build the image pipe swapchain Vulkan layers,
# each one has one loadable module, and a JSON configuration file.
#
# fuchsia_component() and fuchsia_package() instances should depend on
# 'image_pipe_swapchain_layer' or 'image_pipe_swapchain_xxx_layer' to get both
# the module and the configuration file properly installed into the final package.
# IMPORTANT: Keep in sync with //src/lib/vulkan/swapchain/sdk_atom_info.gni
import("//build/dist/resource.gni")
source_set("surface_header") {
sources = [ "image_pipe_surface.h" ]
public_deps = [
"//sdk/fidl/fuchsia.images",
"//src/lib/vulkan:headers",
]
}
loadable_module("swapchain") {
output_name = "VkLayer_image_pipe_swapchain"
sources = [
"fuchsia_platform_event.cc",
"image_pipe_surface_async.cc",
"image_pipe_surface_async.h",
"image_pipe_swapchain_layer.cc",
"vulkan_utils.cc",
"vulkan_utils.h",
]
deps = [
":surface_header",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_llcpp",
"//sdk/lib/fdio",
"//src/lib/fsl",
"//third_party/Vulkan-ValidationLayers:micro_layer_common",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/trace",
]
ldflags = [ "-static-libstdc++" ]
}
resource("swapchain-config") {
sources = [ "VkLayer_image_pipe_swapchain.json" ]
outputs = [ "data/vulkan/explicit_layer.d/{{source_file_part}}" ]
visibility = [ ":*" ]
}
group("image_pipe_swapchain_layer") {
deps = [
":swapchain",
":swapchain-config",
]
}
source_set("display") {
sources = [
"fuchsia_platform_event.cc",
"image_pipe_surface_display.cc",
"image_pipe_surface_display.h",
"vulkan_utils.cc",
"vulkan_utils.h",
]
deps = [
":surface_header",
"//sdk/fidl/fuchsia.hardware.display:fuchsia.hardware.display_c",
"//sdk/fidl/fuchsia.sysmem",
"//sdk/lib/fdio",
"//src/lib/fsl",
"//third_party/Vulkan-ValidationLayers:micro_layer_common",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fdio-caller",
"//zircon/system/ulib/fzl",
]
public_deps = [
"//sdk/fidl/fuchsia.hardware.display",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
loadable_module("fb") {
output_name = "VkLayer_image_pipe_swapchain_fb"
defines = [ "USE_IMAGEPIPE_SURFACE_FB" ]
sources = [ "image_pipe_swapchain_layer.cc" ]
deps = [
":display",
":surface_header",
"//third_party/Vulkan-ValidationLayers:micro_layer_common",
"//zircon/system/ulib/trace",
]
ldflags = [ "-static-libstdc++" ]
}
resource("fb-config") {
sources = [ "VkLayer_image_pipe_swapchain_fb.json" ]
outputs = [ "data/vulkan/explicit_layer.d/{{source_file_part}}" ]
visibility = [ ":*" ]
}
group("image_pipe_swapchain_fb_layer") {
deps = [
":fb",
":fb-config",
]
}
loadable_module("fb_skip_present") {
output_name = "VkLayer_image_pipe_swapchain_fb_skip_present"
defines = [
"USE_IMAGEPIPE_SURFACE_FB",
"SKIP_PRESENT",
]
sources = [ "image_pipe_swapchain_layer.cc" ]
deps = [
":display",
":surface_header",
"//third_party/Vulkan-ValidationLayers:micro_layer_common",
"//zircon/system/ulib/trace",
]
ldflags = [ "-static-libstdc++" ]
}
resource("fb_skip_present-config") {
sources = [ "VkLayer_image_pipe_swapchain_fb_skip_present.json" ]
outputs = [ "data/vulkan/explicit_layer.d/{{source_file_part}}" ]
visibility = [ ":*" ]
}
group("image_pipe_swapchain_fb_skip_present_layer") {
deps = [
":fb_skip_present",
":fb_skip_present-config",
]
}
loadable_module("copy") {
testonly = true # Not intended for production use
output_name = "VkLayer_image_pipe_swapchain_copy"
defines = [ "USE_SWAPCHAIN_SURFACE_COPY" ]
sources = [
"image_pipe_swapchain_layer.cc",
"swapchain_copy_surface.cc",
"swapchain_copy_surface.h",
]
public_deps = [ "//third_party/Vulkan-ValidationLayers:micro_layer_common" ]
deps = [ ":surface_header" ]
if (is_fuchsia) {
sources += [ "fuchsia_platform_event.cc" ]
deps += [ "//zircon/system/ulib/trace" ]
ldflags = [ "-static-libstdc++" ]
}
if (is_linux) {
sources += [ "linux_platform_event.cc" ]
}
}
resource("copy-config") {
sources = [ "VkLayer_image_pipe_swapchain_copy.json" ]
outputs = [ "data/vulkan/explicit_layer.d/{{source_file_part}}" ]
visibility = [ ":*" ]
}
group("image_pipe_swapchain_copy_layer") {
testonly = true
deps = [
":copy",
":copy-config",
]
}
if (is_linux) {
loadable_module("wayland_copy") {
output_name = "VkLayer_wayland_swapchain_copy"
defines = [ "USE_SWAPCHAIN_SURFACE_COPY" ]
sources = [
"image_pipe_swapchain_layer.cc",
"linux_platform_event.cc",
"swapchain_copy_surface.cc",
"swapchain_copy_surface.h",
]
deps = [
":surface_header",
"//third_party/Vulkan-ValidationLayers:micro_layer_common",
]
}
}
group("wayland_copy_linux_x64") {
deps = [ ":wayland_copy(//build/toolchain:linux_x64)" ]
}