Hash :
37b2487b
Author :
Date :
2024-05-03T09:55:04
Add LunarG api dump layer to ANGLE vulkan back-end Bug: angleproject:8623 Change-Id: Ia4dbd5915c5fe918cd65e09b468e0b8d094522f7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5601070 Commit-Queue: Mark Łobodziński <mark@lunarg.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
# Copyright 2020 The ANGLE Project 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("//build_overrides/swiftshader.gni")
import("../../../gni/angle.gni")
if (angle_use_wayland) {
import("//build_overrides/wayland.gni")
}
declare_args() {
angle_use_custom_libvulkan = !is_android && !is_fuchsia && !is_ggp
# On real CrOS devices, we should use the system Vulkan loader. On the
# ChromeOS-for-Linux build, we should use the built libvulkan because the
# build is used for MSAN tests. Mixing the non-MSAN system libvulkan with the
# MSAN ANGLE build can result in false positives.
if (is_chromeos && is_chromeos_device) {
angle_use_custom_libvulkan = false
}
}
config("angle_libvulkan_config") {
if (angle_use_custom_libvulkan) {
defines = [ "ANGLE_USE_CUSTOM_LIBVULKAN" ]
}
}
angle_source_set("angle_libvulkan_loader") {
public_configs = [ ":angle_libvulkan_config" ]
sources = [
"libvulkan_loader.cpp",
"libvulkan_loader.h",
]
deps = [ "$angle_root:angle_common" ]
}
if (angle_enable_vulkan || angle_build_vulkan_system_info) {
config("angle_vulkan_headers_config") {
if (angle_shared_libvulkan) {
defines = [ "ANGLE_SHARED_LIBVULKAN=1" ]
}
if (angle_use_wayland) {
include_dirs = [ "$wayland_dir/src" ]
}
configs = [ "$angle_root:angle_vulkan_wayland_config" ]
}
angle_source_set("angle_vulkan_headers") {
sources = [ "vk_headers.h" ]
if (angle_shared_libvulkan) {
public_deps = [ "$angle_root/src/third_party/volk:volk" ]
} else {
public_deps = [ "$angle_vulkan_headers_dir:vulkan_headers" ]
}
public_configs = [ ":angle_vulkan_headers_config" ]
}
angle_source_set("angle_vulkan_icd") {
sources = [
"vulkan_icd.cpp",
"vulkan_icd.h",
]
defines =
[ "ANGLE_VK_MOCK_ICD_JSON=\"$angle_data_dir/VkICD_mock_icd.json\"" ]
# On Fuchsia use validation layer provided by the SDK.
if (!is_fuchsia) {
defines += [ "ANGLE_VK_LAYERS_DIR=\"$angle_data_dir\"" ]
}
data_deps = []
if (angle_enable_swiftshader) {
import("$swiftshader_dir/src/Vulkan/vulkan.gni")
_sws_icd = "./$swiftshader_icd_file_name"
if (is_win) {
_sws_icd = ".\\\\$swiftshader_icd_file_name"
} else if (is_fuchsia) {
_sws_icd = "/pkg/$swiftshader_icd_file_name"
}
defines += [ "ANGLE_VK_SWIFTSHADER_ICD_JSON=\"${_sws_icd}\"" ]
data_deps += [
"$swiftshader_dir/src/Vulkan:icd_file",
"$swiftshader_dir/src/Vulkan:swiftshader_libvulkan",
]
}
public_deps = [
":angle_vulkan_headers",
"$angle_root:angle_common",
]
configs += [ "$angle_root:angle_no_cfi_icall" ]
}
}
if (angle_enable_vulkan) {
group("angle_libvulkan") {
public_configs = [ ":angle_libvulkan_config" ]
data_deps = []
if (angle_use_custom_libvulkan) {
if (angle_shared_libvulkan) {
data_deps += [ "$angle_vulkan_loader_dir:libvulkan" ]
} else {
public_deps = [ "$angle_vulkan_loader_dir:libvulkan" ]
}
data_deps += [ "$angle_vulkan_tools_dir:VkICD_mock_icd" ]
}
}
group("angle_vulkan_entry_points") {
public_deps = [ ":angle_vulkan_headers" ]
if (is_fuchsia) {
public_deps += [
"$angle_root/src/common/fuchsia_egl",
"//third_party/fuchsia-sdk/sdk/pkg/vulkan",
]
if (!angle_use_vulkan_null_display) {
public_deps += [ "//third_party/fuchsia-sdk/sdk/pkg/vulkan_layers:VkLayer_image_pipe_swapchain" ]
}
} else if (!is_android && !is_ggp) {
if (angle_shared_libvulkan) {
data_deps = [ "$angle_vulkan_loader_dir:libvulkan" ]
} else {
deps = [ "$angle_vulkan_loader_dir:libvulkan" ]
}
}
}
angle_source_set("vulkan") {
public_deps = [
":angle_libvulkan",
":angle_vulkan_entry_points",
":angle_vulkan_icd",
]
}
if (angle_enable_vulkan_validation_layers) {
group("vulkan_validation_layers") {
data_deps = []
if (is_fuchsia) {
data_deps += [ "//third_party/fuchsia-sdk/sdk/pkg/vulkan_layers:VkLayer_khronos_validation" ]
} else {
data_deps +=
[ "$angle_vulkan_validation_layers_dir:vulkan_validation_layers" ]
if (!is_android) {
data_deps +=
[ "$angle_vulkan_validation_layers_dir:vulkan_gen_json_files" ]
}
}
}
}
if (angle_enable_vulkan_api_dump_layer) {
group("lunarg_vulkantools") {
data_deps = []
if (!is_fuchsia) {
data_deps += [ "$angle_lunarg_vulkantools_dir:lunarg_vulkantools" ]
if (!is_android) {
data_deps += [ "$angle_lunarg_vulkantools_dir:vulkan_gen_json_files" ]
}
}
}
}
}