Add ANGLE to Dawn build.

Bug: dawn:447, dawn:580
Change-Id: I77726651ca00d64768bddc0bb476fd920e11851f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35081
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Stephen White 2021-01-11 15:52:12 +00:00 committed by Commit Bot service account
parent 99c3a691c2
commit 77fcdf7eaa
7 changed files with 76 additions and 0 deletions

15
.gn
View File

@ -23,6 +23,21 @@ default_args = {
# Chromium is still on 10.10).
mac_deployment_target = "10.11.0"
mac_min_system_version = "10.11.0"
angle_enable_abseil = false
angle_standalone = false
angle_build_all = false
angle_vulkan_headers_dir = "//third_party/vulkan-deps/vulkan-headers/src"
angle_vulkan_loader_dir = "//third_party/vulkan-deps/vulkan-loader/src"
angle_vulkan_tools_dir = "//third_party/vulkan-deps/vulkan-tools/src"
angle_vulkan_validation_layers_dir =
"//third_party/vulkan-deps/vulkan-validation-layers/src"
}
check_targets = [

14
DEPS
View File

@ -80,6 +80,16 @@ deps = {
'condition': 'dawn_standalone',
},
'third_party/vulkan_memory_allocator': {
'url': '{chromium_git}/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator@065e739079d9d58bef28ccd793cbf512261f09ed',
'condition': 'dawn_standalone',
},
'third_party/angle': {
'url': '{chromium_git}/angle/angle@f4cd17472aca1939277b145ef0f72b0946b83716',
'condition': 'dawn_standalone',
},
'third_party/swiftshader': {
'url': '{swiftshader_git}/SwiftShader@df17a76102dfabb3f1bd6e51449cece9f77b45e3',
'condition': 'dawn_standalone',
@ -87,6 +97,10 @@ deps = {
'third_party/vulkan-deps': {
'url': '{chromium_git}/vulkan-deps@c493c61120215a00f54cc59f067f7419dabad066',
},
'third_party/zlib': {
'url': '{chromium_git}/chromium/src/third_party/zlib@c29ee8c9c3824ca013479bf8115035527967fe02',
'condition': 'dawn_standalone',
},
}

26
build_overrides/angle.gni Normal file
View File

@ -0,0 +1,26 @@
# Copyright 2020 The Dawn Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Override for angle_root
angle_root = "//third_party/angle"
# True if ANGLE can access build/, testing/ and other Chrome folders.
angle_has_build = true
# Paths to ANGLE dependencies in Dawn
angle_glslang_dir = "//third_party/vulkan-deps/glslang/src"
angle_spirv_cross_dir = "//third_party/vulkan-deps/spirv-cross/src"
angle_spirv_headers_dir = "//third_party/vulkan-deps/spirv-headers/src"
angle_spirv_tools_dir = "//third_party/vulkan-deps/spirv-tools/src"
angle_vulkan_memory_allocator_dir = "//third_party/vulkan_memory_allocator"

View File

@ -27,6 +27,7 @@ dawn_has_build = true
# users of Dawn don't have to set dirs if they happen to use the same as Dawn.
# The paths to Dawn's dependencies
dawn_angle_dir = "//third_party/angle"
dawn_jinja2_dir = "//third_party/jinja2"
dawn_glfw_dir = "//third_party/glfw"
dawn_glm_dir = "//third_party/glm"

View File

@ -0,0 +1,8 @@
# Copyright 2019 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.
vulkan_headers_dir = "//third_party/vulkan-deps/vulkan-headers/src"
vulkan_data_subdir = "vulkandata"
vulkan_gen_subdir = "angle/vulkan"

View File

@ -27,6 +27,8 @@ if (build_with_chromium) {
}
declare_args() {
dawn_use_angle = true
# Enables usage of swiftshader on the Vulkan backend.
# Note that this will only work in standalone and in projects that set the
# dawn_swiftshader_dir variable in build_overrides/dawn.gni

View File

@ -35,6 +35,9 @@ if (enable_vulkan_validation_layers) {
import("//build_overrides/vulkan_validation_layers.gni")
}
# ANGLE is an optional dependency; only use it if the path has been set.
use_angle = dawn_use_angle && defined(dawn_angle_dir)
# Swiftshader is an optional dependency, only use it if the path has been set.
use_swiftshader = dawn_use_swiftshader && dawn_swiftshader_dir != ""
if (use_swiftshader) {
@ -603,6 +606,13 @@ source_set("dawn_native_sources") {
}
}
if (use_angle) {
data_deps += [
"${dawn_angle_dir}:libEGL",
"${dawn_angle_dir}:libGLESv2",
]
}
if (dawn_enable_wgsl) {
deps += [ "${dawn_tint_dir}:libtint" ]
}