| # 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/src" |
| |
| 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/error_location_helper.cpp", |
| "$validation_layer_dir/layers/vulkan/generated/error_location_helper.h", |
| "$validation_layer_dir/layers/vulkan/generated/vk_api_version.h", |
| "$validation_layer_dir/layers/vulkan/generated/vk_dispatch_table_helper.cpp", |
| "$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/src:vulkan_headers", |
| "//third_party/Vulkan-Utility-Libraries/src:vulkan_layer_settings", |
| ] |
| } |
| |
| 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.sysmem:fuchsia.sysmem_cpp", |
| "//sdk/fidl/fuchsia.sysmem2:fuchsia.sysmem2_cpp", |
| "//sdk/fidl/fuchsia.ui.composition:fuchsia.ui.composition_cpp", |
| "//sdk/fidl/fuchsia.ui.views:fuchsia.ui.views_cpp", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/ui/scenic/cpp", |
| "//src/lib/fsl", |
| "//src/lib/ui/flatland-frame-scheduling:simple_present", |
| "//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 = [ |
| "display_coordinator_listener.cc", |
| "display_coordinator_listener.h", |
| "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.types:fuchsia.hardware.display.types_cpp", |
| "//sdk/fidl/fuchsia.images2:fuchsia.images2_cpp", |
| "//sdk/fidl/fuchsia.sysmem2:fuchsia.sysmem2_cpp", |
| "//sdk/lib/async:async-cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/fdio", |
| "//src/lib/fsl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/fdio-caller", |
| "//zircon/system/ulib/fzl", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.hardware.display:fuchsia.hardware.display_cpp", |
| "//sdk/fidl/fuchsia.hardware.display.types:fuchsia.hardware.display.types_cpp", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/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", |
| ] |
| } |