blob: d60c0181424397529d8ca9201b206ee5bddf566c [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.
import("//third_party/flatbuffers/flatbuffer.gni")
declare_args() {
# 0 - use normal swapchain
# 1 - use vulkan swapchain, but wait for real display
# 2 - use vulkan swapchain with fixed-size fake display
if (target_cpu == "arm64") {
scenic_vulkan_swapchain = 1
} else {
scenic_vulkan_swapchain = 0
}
scenic_ignore_vsync = false
}
config("common_include_dirs") {
include_dirs = [
"//garnet",
"//third_party/glm",
]
}
config("swapchain") {
defines = [
"SCENIC_VULKAN_SWAPCHAIN=$scenic_vulkan_swapchain",
"SCENIC_IGNORE_VSYNC=$scenic_ignore_vsync",
]
}
source_set("common_gfx_config_source_set") {
visibility = [
":gfx_always_optimized",
":gfx",
]
}
# These sources (all part of :gfx) are especially performance-sensitive, so we
# apply full optimization in debug as well as --release.
source_set("gfx_always_optimized") {
visibility = [ ":gfx" ]
sources = [
"util/image_formats.cc",
"util/image_formats.h",
]
cflags = [
# Always optimize regardless of debug or --release.
"-O3",
]
public_configs = [ ":common_include_dirs" ]
public_deps = [
"//garnet/public/lib/escher",
]
deps = [
"//garnet/lib/ui/yuv",
"//garnet/public/lib/images/cpp",
]
}
source_set("gfx") {
sources = [
"displays/display.cc",
"displays/display.h",
"displays/display_manager.cc",
"displays/display_manager.h",
"displays/display_watcher.cc",
"displays/display_watcher.h",
"engine/engine.cc",
"engine/engine.h",
"engine/frame_scheduler.cc",
"engine/frame_scheduler.h",
"engine/frame_timings.cc",
"engine/frame_timings.h",
"engine/hit.h",
"engine/hit_tester.cc",
"engine/hit_tester.h",
"engine/resource_linker.cc",
"engine/resource_linker.h",
"engine/resource_map.cc",
"engine/resource_map.h",
"engine/session.cc",
"engine/session.h",
"engine/session_handler.cc",
"engine/session_handler.h",
"engine/session_manager.cc",
"engine/session_manager.h",
"engine/unresolved_imports.cc",
"engine/unresolved_imports.h",
"engine/update_scheduler.h",
"gfx_system.cc",
"gfx_system.h",
"id.cc",
"id.h",
"resources/buffer.cc",
"resources/buffer.h",
"resources/camera.cc",
"resources/camera.h",
"resources/compositor/compositor.cc",
"resources/compositor/compositor.h",
"resources/compositor/display_compositor.cc",
"resources/compositor/display_compositor.h",
"resources/compositor/layer.cc",
"resources/compositor/layer.h",
"resources/compositor/layer_stack.cc",
"resources/compositor/layer_stack.h",
"resources/dump_visitor.cc",
"resources/dump_visitor.h",
"resources/gpu_image.cc",
"resources/gpu_image.h",
"resources/host_image.cc",
"resources/host_image.h",
"resources/image.cc",
"resources/image.h",
"resources/image_base.cc",
"resources/image_base.h",
"resources/image_pipe.cc",
"resources/image_pipe.h",
"resources/image_pipe_handler.cc",
"resources/image_pipe_handler.h",
"resources/import.cc",
"resources/import.h",
"resources/lights/ambient_light.cc",
"resources/lights/ambient_light.h",
"resources/lights/directional_light.cc",
"resources/lights/directional_light.h",
"resources/lights/light.cc",
"resources/lights/light.h",
"resources/material.cc",
"resources/material.h",
"resources/memory.cc",
"resources/memory.h",
"resources/nodes/entity_node.cc",
"resources/nodes/entity_node.h",
"resources/nodes/node.cc",
"resources/nodes/node.h",
"resources/nodes/opacity_node.cc",
"resources/nodes/opacity_node.h",
"resources/nodes/scene.cc",
"resources/nodes/scene.h",
"resources/nodes/shape_node.cc",
"resources/nodes/shape_node.h",
"resources/nodes/traversal.h",
"resources/nodes/variable_binding.cc",
"resources/nodes/variable_binding.h",
"resources/renderers/renderer.cc",
"resources/renderers/renderer.h",
"resources/resource.cc",
"resources/resource.h",
"resources/resource_type_info.h",
"resources/resource_visitor.cc",
"resources/resource_visitor.h",
"resources/shapes/circle_shape.cc",
"resources/shapes/circle_shape.h",
"resources/shapes/mesh_shape.cc",
"resources/shapes/mesh_shape.h",
"resources/shapes/planar_shape.cc",
"resources/shapes/planar_shape.h",
"resources/shapes/rectangle_shape.cc",
"resources/shapes/rectangle_shape.h",
"resources/shapes/rounded_rectangle_shape.cc",
"resources/shapes/rounded_rectangle_shape.h",
"resources/shapes/shape.cc",
"resources/shapes/shape.h",
"resources/snapshot/serializer.h",
"resources/snapshot/snapshotter.cc",
"resources/snapshot/snapshotter.h",
"resources/snapshot/version.h",
"resources/stereo_camera.cc",
"resources/stereo_camera.h",
"resources/variable.cc",
"resources/variable.h",
"resources/view.cc",
"resources/view.h",
"resources/view_holder.cc",
"resources/view_holder.h",
"screenshotter.cc",
"screenshotter.h",
"swapchain/display_swapchain.cc",
"swapchain/display_swapchain.h",
"swapchain/swapchain.h",
"swapchain/vulkan_display_swapchain.cc",
"swapchain/vulkan_display_swapchain.h",
"util/event_timestamper.cc",
"util/event_timestamper.h",
"util/time.h",
"util/unwrap.h",
"util/vulkan_utils.cc",
"util/vulkan_utils.h",
"util/wrap.h",
]
public_configs = [ ":common_include_dirs" ]
configs += [ ":swapchain" ]
public_deps = [
":gfx_always_optimized",
":snapshot_fbs",
"//garnet/lib/ui/scenic",
"//garnet/public/fidl/fuchsia.math",
"//garnet/public/fidl/fuchsia.ui.gfx",
"//garnet/public/lib/component/cpp",
"//garnet/public/lib/fidl/cpp",
"//garnet/public/lib/fsl",
"//garnet/public/lib/fxl",
"//garnet/public/lib/ui/geometry/cpp",
"//garnet/public/lib/vulkan",
"//zircon/public/lib/fit",
]
deps = [
":object_linker",
"//garnet/lib/ui/scenic/util",
"//garnet/public/lib/escher/util:check_vulkan_support",
"//garnet/public/lib/ui/scenic/cpp",
"//zircon/public/fidl/fuchsia-display",
"//zircon/public/fidl/fuchsia-sysmem",
"//zircon/public/lib/trace",
]
}
source_set("object_linker") {
sources = [
"engine/object_linker.cc",
"engine/object_linker.h",
]
public_deps = [
"//garnet/lib/ui/scenic/util",
"//garnet/public/lib/fsl",
"//garnet/public/lib/fxl",
"//zircon/public/lib/fit",
]
}
flatbuffer("snapshot_fbs") {
sources = [
"resources/snapshot/snapshot.fbs",
]
}