| # 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 = [ "//src/lib/vulkan:headers" ] |
| } |
| |
| validation_layer_dir = "//third_party/Vulkan-ValidationLayers" |
| |
| config("vulkan_layer_config") { |
| include_dirs = [ |
| "$validation_layer_dir/layers", |
| "$validation_layer_dir/layers/utils", |
| "$validation_layer_dir/layers/vulkan", |
| "$validation_layer_dir/layers/vulkan/generated", |
| ] |
| cflags = [ "-Wno-extra-semi" ] |
| } |
| |
| source_set("layer_common") { |
| public_configs = [ ":vulkan_layer_config" ] |
| |
| sources = [ |
| "$validation_layer_dir/layers/containers/custom_containers.h", |
| "$validation_layer_dir/layers/utils/vk_layer_extension_utils.cpp", |
| "$validation_layer_dir/layers/utils/vk_layer_extension_utils.h", |
| "$validation_layer_dir/layers/vulkan/generated/vk_api_version.h", |
| "$validation_layer_dir/layers/vulkan/generated/vk_dispatch_table_helper.h", |
| "$validation_layer_dir/layers/vulkan/generated/vk_extension_helper.h", |
| "$validation_layer_dir/layers/vulkan/generated/vk_layer_dispatch_table.h", |
| ] |
| |
| public_deps = [ "//third_party/Vulkan-Headers: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 = [ |
| ":layer_common", |
| ":surface_header", |
| "//sdk/fidl/fuchsia.sysmem2:fuchsia.sysmem2_cpp", |
| "//sdk/fidl/fuchsia.ui.composition:fuchsia.ui.composition_hlcpp", |
| "//sdk/fidl/fuchsia.ui.views:fuchsia.ui.views_hlcpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/ui/scenic/cpp", |
| "//src/lib/fsl", |
| "//src/lib/ui/flatland-frame-scheduling:simple_present", |
| "//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 = [ |
| ":layer_common", |
| ":surface_header", |
| "//sdk/fidl/fuchsia.hardware.display:fuchsia.hardware.display_cpp", |
| "//sdk/fidl/fuchsia.images2:fuchsia.images2_cpp", |
| "//sdk/fidl/fuchsia.sysmem2:fuchsia.sysmem2_hlcpp", |
| "//sdk/lib/fdio", |
| "//src/lib/fsl", |
| "//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:fuchsia.hardware.display_hlcpp", |
| "//sdk/fidl/fuchsia.hardware.display.types:fuchsia.hardware.display.types_hlcpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| loadable_module("fb") { |
| output_name = "VkLayer_image_pipe_swapchain_fb" |
| defines = [ "USE_IMAGEPIPE_SURFACE_FB" ] |
| sources = [ "image_pipe_swapchain_layer.cc" ] |
| deps = [ |
| ":display", |
| ":layer_common", |
| ":surface_header", |
| "//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", |
| ":layer_common", |
| ":surface_header", |
| "//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 = [ ":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 = [ |
| ":layer_common", |
| ":surface_header", |
| ] |
| } |
| } |
| |
| group("wayland_copy_linux_x64") { |
| deps = [ ":wayland_copy(//build/toolchain:linux_x64)" ] |
| } |