Skip to content

Commit

Permalink
Merge branch 'google:main' into angle-renderdragon
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherHX authored Mar 24, 2023
2 parents ef8fa53 + 85735eb commit f4ca15d
Show file tree
Hide file tree
Showing 630 changed files with 33,469 additions and 12,875 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
/third_party/jdk/extras/java_8
/third_party/jinja2
/third_party/jsoncpp
/third_party/kotlin_stdlib
/third_party/libdrm
/third_party/libjpeg_turbo
/third_party/libpng/src
Expand Down
2 changes: 1 addition & 1 deletion .style.yapf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[style]
based_on_style = chromium
based_on_style = yapf
column_limit = 99
indent_width = 4
79 changes: 54 additions & 25 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ declare_args() {

# Don't build extra (test, samples etc) for Windows UWP. We don't have
# infrastructure (e.g. windowing helper functions) in place to run them.
# Also don't build them with MSVC, because tests and unused dependencies
# often have problems building with it, e.g. for C++20.
angle_build_all = !build_with_chromium && !angle_is_winuwp &&
angle_has_build && angle_build_tests
!angle_is_msvc && angle_has_build && angle_build_tests

# Enable generating current commit information using git
angle_enable_commit_id = true
Expand Down Expand Up @@ -94,6 +96,7 @@ if (angle_build_all) {
}
}

import("src/angle_program_serialize_data_version.gni")
import("src/compiler.gni")
import("src/libGLESv2.gni")

Expand Down Expand Up @@ -229,6 +232,10 @@ config("internal_config") {
if (angle_build_mesa) {
defines += [ "ANGLE_HAS_MESA" ]
}

if (angle_standalone || build_with_chromium) {
defines += [ "ANGLE_OUTSIDE_WEBKIT" ]
}
}

config("constructor_and_destructor_warnings") {
Expand Down Expand Up @@ -314,24 +321,11 @@ config("build_id_config") {
ldflags = [ "-Wl,--build-id" ]
}

_use_copy_compiler_dll = angle_has_build && is_win && target_cpu != "arm64"
_use_copy_compiler_dll = angle_has_build && is_win

# Windows ARM64 is available since 10.0.16299 so no need to copy
# d3dcompiler_47.dll because this file is available as inbox.
if (_use_copy_compiler_dll) {
# We also ship an older DLL for compatiblity with Windows 7 machines without
# the UCRT. This DLL isn't available in the standard SDK distribution.
_old_compiler = "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_old.dll"
_has_old_compiler =
exec_script("scripts/file_exists.py", [ _old_compiler ], "value")

copy("copy_compiler_dll") {
sources = [ "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll" ]

if (_has_old_compiler) {
sources += [ _old_compiler ]
}

outputs = [ "$root_out_dir/{{source_file_part}}" ]
}
}
Expand Down Expand Up @@ -730,6 +724,7 @@ template("translator_lib") {
public_configs += [ ":external_config" ]

deps = [
":angle_common_shader_state",
":includes",
":preprocessor",
"$angle_root/src/common/spirv:angle_spirv_headers",
Expand All @@ -748,6 +743,7 @@ template("translator_lib") {
public_deps = [
":angle_common",
":angle_translator_headers",
":angle_version_info",
]

if (is_win) {
Expand Down Expand Up @@ -779,6 +775,31 @@ angle_source_set("translator_fuzzer") {
deps = [ ":translator" ]
}

config("angle_program_version_id_config") {
include_dirs = [ "$root_gen_dir/angle" ]
visibility = [ ":angle_program_version_id" ]
}

action("angle_program_version_id") {
response_file_contents =
rebase_path(angle_code_affecting_program_serialize, root_build_dir)

_program_version_header = "$root_gen_dir/angle/ANGLEShaderProgramVersion.h"
script = "src/program_serialize_data_version.py"
outputs = [ _program_version_header ]

visibility = [ ":angle_version" ]

inputs = angle_code_affecting_program_serialize

args = [
rebase_path(_program_version_header, root_build_dir),
"{{response_file_name}}",
]

public_configs = [ ":angle_program_version_id_config" ]
}

config("angle_commit_id_config") {
include_dirs = [ "$root_gen_dir/angle" ]
visibility = [ ":angle_commit_id" ]
Expand All @@ -795,8 +816,9 @@ action("angle_commit_id") {
if (angle_enable_commit_id &&
exec_script("src/commit_id.py", [ "check" ], "value") == 1) {
# commit id should depend on angle's HEAD revision
inputs = [ ".git/HEAD" ]
branch = read_file(".git/HEAD", "string")
git_dirs = exec_script("src/commit_id.py", [ "get_git_dirs" ], "list lines")
inputs = [ git_dirs[0] + "/HEAD" ]
branch = read_file(git_dirs[0] + "/HEAD", "string")
result = string_split(branch)
if (result[0] == "ref:") {
_ref_file = result[1]
Expand All @@ -809,7 +831,7 @@ action("angle_commit_id") {
_ref_file,
],
"")
inputs += [ ".git/" + _ref_file ]
inputs += [ git_dirs[1] + "/" + _ref_file ]
}
}

Expand All @@ -823,7 +845,10 @@ action("angle_commit_id") {

angle_source_set("angle_version") {
sources = [ "src/common/angle_version.h" ]
public_deps = [ ":angle_commit_id" ]
public_deps = [
":angle_commit_id",
":angle_program_version_id",
]
visibility = [ ":angle_version_info" ]

# The version headers are used directly in Windows .RC files.
Expand All @@ -849,7 +874,10 @@ angle_source_set("angle_version_info") {
"src/common/angle_version_info.cpp",
"src/common/angle_version_info.h",
]
deps = [ ":angle_version" ]
deps = [
":angle_translator_headers",
":angle_version",
]
}

config("angle_backend_config") {
Expand Down Expand Up @@ -943,7 +971,6 @@ angle_source_set("libANGLE_headers") {
}
public_deps = [
":angle_common",
":angle_common_shader_state",
":angle_translator_headers",
]
public_configs += [ ":libANGLE_config" ]
Expand Down Expand Up @@ -1063,8 +1090,6 @@ angle_source_set("libANGLE_no_vulkan") {
":angle_backend_config",
]

# Windows ARM64 is available since 10.0.16299 so no need to copy
# d3dcompiler_47.dll because this file is available as inbox.
if (_use_copy_compiler_dll) {
data_deps = [ ":copy_compiler_dll" ]
}
Expand Down Expand Up @@ -1100,7 +1125,7 @@ angle_source_set("angle_gl_enum_utils") {

if (angle_use_wayland) {
config("angle_wayland_config") {
if (use_system_libwayland) {
if ("$wayland_gn_dir" == "") {
libs = [
"wayland-client",
"wayland-egl",
Expand All @@ -1116,7 +1141,7 @@ if (angle_use_wayland) {
group("angle_wayland") {
public_configs = [ ":angle_wayland_config" ]

if (!use_system_libwayland) {
if ("$wayland_gn_dir" != "") {
# Use third-party targets
public_deps = [
"$wayland_gn_dir:wayland_client",
Expand Down Expand Up @@ -1748,6 +1773,10 @@ group("angle") {
":libGLESv2_vulkan_secondaries",
]
}
if (is_ios) {
# Need to bundle the libraries inside the .app.
deps = data_deps
}
}

group("angle_static") {
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ Adobe Systems Inc.
Steve Minns
Max Vujovic

Apple Inc.
Dan Glastonbury
Dean Jackson
Kimmo Kinnunen
Kyle Piddington

Autodesk, Inc.
Ranger Harke

Expand Down
Loading

0 comments on commit f4ca15d

Please sign in to comment.