angle/BUILD.gn

1229 строки
26 KiB
Plaintext
Исходник Обычный вид История

# 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.
# import the use_x11 variable
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("gni/angle.gni")
if (is_android) {
# android/rules.gni can only be imported for Android targets
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("android/angle_apk.gni")
}
declare_args() {
# Use the PCI lib to collect GPU information on Linux.
use_libpci = is_linux && (!is_chromecast || is_cast_desktop_build) &&
(use_x11 || use_ozone)
# Link in system libGL, to work with apitrace. See doc/DebuggingTips.md.
angle_link_glx = false
# Defaults to capture building to $root_out_dir/angle_libs/with_capture.
# Switch on to build capture to $root_out_dir.
angle_with_capture_by_default = false
# 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.
angle_build_all = !angle_is_winuwp
}
if (!build_with_chromium && angle_build_all) {
group("all") {
testonly = true
deps = [
":angle_shader_translator",
":translator_fuzzer",
":xxhash_fuzzer",
"//samples:all",
"//src/tests:all",
]
}
}
if (ozone_platform_gbm) {
pkg_config("libdrm") {
packages = [ "libdrm" ]
}
}
angle_git_is_present = exec_script("src/commit_id.py",
[
"check",
rebase_path(".", root_build_dir),
],
"value")
angle_use_commit_id = angle_git_is_present == 1
Revert "Enhance ANGLE for Android Developer Options" This reverts commit fdbdb2b247ffa4cf66bc2cd3a5bb45a056bd88a3. Reason for revert: I didn't mean to land this quite yet, since we are still working on the Android side of things. It seems doing CQ+2 merges it while I was trying for just a dry run while replying to Jamie's comments with updates (after checking with Boulder folks, I want CQ+1 next time). Once the Android changes are ready, I'll work on getting this landed again. Original change's description: > Enhance ANGLE for Android Developer Options > > Update ANGLE Developer Options > > Update ANGLE developer options to allow selecting the OpenGL driver > (default, ANGLE, native) for each app as well as forcing ANGLE for all > apps. > > Bug: angleproject:2962 > Test: Verify the default/ANGLE/native values are saved and applied and > used by the loader. > > Change-Id: I6041e7e49ca5cc65f90fc8ae6f1b084e4639d769 > Reviewed-on: https://chromium-review.googlesource.com/c/1330315 > Commit-Queue: Tim Van Patten <timvp@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=ynovikov@chromium.org,geofflang@chromium.org,jmadill@chromium.org,cnorthrop@google.com,tobine@google.com,courtneygo@google.com,ianelliott@google.com,timvp@google.com Change-Id: If3a4e917973c56b858244a0ca7f1b164143524f5 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2962 Reviewed-on: https://chromium-review.googlesource.com/c/1354099 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
2018-11-28 19:08:11 +03:00
import("src/compiler.gni")
import("src/libGLESv2.gni")
# This config is exported to dependent targets (and also applied to internal
# ones).
config("external_config") {
include_dirs = [ "include" ]
}
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
# Prevent the GL headers from redeclaring ANGLE entry points.
config("no_gl_prototypes") {
defines = [
"GL_GLES_PROTOTYPES=0",
"EGL_EGL_PROTOTYPES=0",
]
}
config("gl_prototypes") {
defines = [
"GL_GLES_PROTOTYPES=1",
"EGL_EGL_PROTOTYPES=1",
"GL_GLEXT_PROTOTYPES",
"EGL_EGLEXT_PROTOTYPES",
]
}
# This config is applied to internal Angle targets (not pushed to dependents).
config("internal_config") {
include_dirs = [
"include",
"src",
]
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
defines = []
if (angle_64bit_current_cpu) {
defines += [ "ANGLE_IS_64_BIT_CPU" ]
} else {
defines += [ "ANGLE_IS_32_BIT_CPU" ]
}
if (angle_enable_trace) {
defines += [ "ANGLE_ENABLE_DEBUG_TRACE=1" ]
}
}
config("extra_warnings") {
cflags = []
# Enable more default warnings on Windows.
if (is_win) {
cflags += [
"/we4244", # Conversion: possible loss of data.
"/we4456", # Variable shadowing.
"/we4458", # declaration hides class member.
"/we4715", # not all control paths return a value
"/we4800", # forcing value to bool.
"/we4838", # narrowing conversion.
]
}
if (is_clang) {
cflags += [
"-Wexit-time-destructors",
"-Wextra-semi-stmt",
"-Wfloat-conversion",
"-Wglobal-constructors",
"-Wnon-virtual-dtor",
"-Wunneeded-internal-declaration",
# The below warnings are used by WebKit. We enable them to make rolling
# ANGLE in WebKit easier.
"-Wparentheses",
"-Wrange-loop-analysis",
"-Wstrict-prototypes",
"-Wunreachable-code",
"-Wshorten-64-to-32",
]
}
if (angle_is_winuwp) {
cflags += [ "/wd4447" ] # 'main' signature found without threading model.
}
}
# This config adds build-ids to the associated library.
# -Wl is a special option that indicates that clang should pass the associated
# option --build-id to the linker. This will cause a build-id section to be added
# to the associated library. The build-id makes it possible for a debugger to
# find the right symbol file to use.
config("build_id_config") {
ldflags = [ "-Wl,--build-id" ]
}
# Useful for more informative stack traces.
config("better_linux_stack_traces") {
if (angle_better_stack_traces) {
ldflags = [ "-Wl,--export-dynamic" ]
}
}
# Windows ARM64 is available since 10.0.16299 so no need to copy
# d3dcompiler_47.dll because this file is available as inbox.
if (is_win && target_cpu != "arm64") {
# 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")
Disable the HLSL code in Angle if it is not being used. We're only using the HLSL code in Windows so it's not necessary to compile and distribute it on other platforms. This adds a defined ANGLE_ENABLE_HLSL that can be checked in files that are used by non-HLSL code as well. Mostly the HLSL code is just not include by the build system. Details of the space savings (heavily truncated) Total change: -165717 bytes =========================== -606 - Source: angle/src/common/utilities.cpp -627 - Source: angle/src/compiler/translator/FlagStd140Structs.cpp -695 - Source: /usr/include/c++/4.8/bits/stl_algo.h -710 - Source: angle/src/compiler/translator/TranslatorHLSL.cpp -713 - Source: angle/src/compiler/translator/IntermNode.h -863 - Source: /usr/include/c++/4.8/bits/stl_map.h -935 - Source: angle/src/compiler/translator/blocklayout.cpp -1515 - Source: angle/src/compiler/translator/BuiltInFunctionEmulator.cpp -1655 - Source: angle/src/compiler/translator/UnfoldShortCircuit.cpp -2375 - Source: /usr/include/c++/4.8/bits/vector.tcc -3135 - Source: angle/src/compiler/translator/RewriteElseBlocks.cpp -4656 - Source: angle/src/compiler/translator/UtilsHLSL.cpp -5265 - Source: angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp -6505 - Source: /usr/include/c++/4.8/bits/stl_tree.h -11480 - Source: angle/src/compiler/translator/UniformHLSL.cpp -13580 - Source: angle/src/compiler/translator/StructureHLSL.cpp -18964 - Source: ?? (constant strings and a few vtbls) -89332 - Source: angle/src/compiler/translator/OutputHLSL.cpp Change-Id: I23ccc98abd0a21f847dd34f9482800b3ba679d56 Reviewed-on: https://chromium-review.googlesource.com/251528 Tested-by: bratell at Opera <bratell@opera.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
2015-02-25 16:34:49 +03:00
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}}",
]
Disable the HLSL code in Angle if it is not being used. We're only using the HLSL code in Windows so it's not necessary to compile and distribute it on other platforms. This adds a defined ANGLE_ENABLE_HLSL that can be checked in files that are used by non-HLSL code as well. Mostly the HLSL code is just not include by the build system. Details of the space savings (heavily truncated) Total change: -165717 bytes =========================== -606 - Source: angle/src/common/utilities.cpp -627 - Source: angle/src/compiler/translator/FlagStd140Structs.cpp -695 - Source: /usr/include/c++/4.8/bits/stl_algo.h -710 - Source: angle/src/compiler/translator/TranslatorHLSL.cpp -713 - Source: angle/src/compiler/translator/IntermNode.h -863 - Source: /usr/include/c++/4.8/bits/stl_map.h -935 - Source: angle/src/compiler/translator/blocklayout.cpp -1515 - Source: angle/src/compiler/translator/BuiltInFunctionEmulator.cpp -1655 - Source: angle/src/compiler/translator/UnfoldShortCircuit.cpp -2375 - Source: /usr/include/c++/4.8/bits/vector.tcc -3135 - Source: angle/src/compiler/translator/RewriteElseBlocks.cpp -4656 - Source: angle/src/compiler/translator/UtilsHLSL.cpp -5265 - Source: angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp -6505 - Source: /usr/include/c++/4.8/bits/stl_tree.h -11480 - Source: angle/src/compiler/translator/UniformHLSL.cpp -13580 - Source: angle/src/compiler/translator/StructureHLSL.cpp -18964 - Source: ?? (constant strings and a few vtbls) -89332 - Source: angle/src/compiler/translator/OutputHLSL.cpp Change-Id: I23ccc98abd0a21f847dd34f9482800b3ba679d56 Reviewed-on: https://chromium-review.googlesource.com/251528 Tested-by: bratell at Opera <bratell@opera.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
2015-02-25 16:34:49 +03:00
}
}
# Holds the shared includes so we only need to list them once.
config("includes_config") {
include_dirs = [ "include" ]
}
angle_source_set("includes") {
sources = libangle_includes
public_configs = [ ":includes_config" ]
}
angle_static_library("preprocessor") {
sources = angle_preprocessor_sources
public_deps = [
":angle_common",
":angle_translator_headers",
]
}
config("angle_disable_pool_alloc") {
defines = [ "ANGLE_DISABLE_POOL_ALLOC" ]
}
config("debug_annotations_config") {
if (is_debug) {
defines = [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ]
}
}
config("angle_release_asserts_config") {
if (dcheck_always_on) {
defines = [ "ANGLE_ENABLE_RELEASE_ASSERTS" ]
}
}
config("angle_common_config") {
include_dirs = [ "src/common/third_party/base" ]
if (is_android) {
libs = [ "log" ]
}
}
if (is_win && !angle_is_winuwp) {
angle_source_set("angle_stack_walker") {
sources = [
"util/windows/third_party/StackWalker/src/StackWalker.cpp",
"util/windows/third_party/StackWalker/src/StackWalker.h",
]
if (is_clang) {
cflags_cc = [
"-Wno-c++98-compat-extra-semi",
"-Wno-missing-declarations",
"-Wno-switch",
]
} else {
cflags_cc = [ "/wd4740" ]
}
}
}
angle_source_set("angle_system_utils") {
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
sources = angle_system_utils_sources
}
Revert "Load correct libGLESv2 on Linux and Mac." This reverts commit dd815b623e60a1e1550f328104ffcd7caf20fde1. Reason for revert: Broke https://luci-milo.appspot.com/p/chromium/builders/luci.chromium.ci/win-rel/8006 Original change's description: > Load correct libGLESv2 on Linux and Mac. > > libEGL was implicitly loading libGLESv2 on startup. This is bad > because on platforms like Linux and Mac we could sometimes use the > incorrect rpath. This in turn meant we needed workarounds like using > "_angle" extensions to our shared objects to get the correct loading > behaviour. > > Fix this by loading libGLESv2 dynamically in libEGL. We build the > loader automatically from egl.xml. The loader itself is lazily > initialized on every EGL entry point call. This is necessary because > on Linux, etc, there is no equivalent to Windows' DLLMain. > > We also use an EGL.h with different generation options so we have the > proper function pointer types. A README is included for instructions > on how to regenerate EGL.h. > > The entry point generation script is refactored into a helper class > that is used in the loader generator. Also adds the libGLESv2 versions > of the EGL entry points in the DEF file on Windows. This allows them to > be imported properly in 32-bit configurations. > > Also fixes up some errors in ANGLE's entry point definitions. Also > includes a clang-format disable rule for the Khronos headers. > > This CL will help us to run ANGLE tests against native drivers. > > Bug: angleproject:2871 > Change-Id: Id6ecf969308f17b1be4083538428c9c1a1836572 > Reviewed-on: https://chromium-review.googlesource.com/c/1370725 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=ynovikov@chromium.org,geofflang@chromium.org,jmadill@chromium.org Change-Id: I921b3c45435ab4f05cbc2d1c1172b4185d6257b0 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2871 Reviewed-on: https://chromium-review.googlesource.com/c/1378887 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2018-12-16 22:53:23 +03:00
angle_source_set("xxhash") {
sources = xxhash_sources
configs -= [ "${angle_root}:extra_warnings" ]
}
fuzzer_test("xxhash_fuzzer") {
sources = [
"src/common/third_party/xxhash/xxhash_fuzzer.cpp",
]
deps = [
":xxhash",
]
}
angle_static_library("angle_common") {
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
sources = libangle_common_sources
Revert "Load correct libGLESv2 on Linux and Mac." This reverts commit dd815b623e60a1e1550f328104ffcd7caf20fde1. Reason for revert: Broke https://luci-milo.appspot.com/p/chromium/builders/luci.chromium.ci/win-rel/8006 Original change's description: > Load correct libGLESv2 on Linux and Mac. > > libEGL was implicitly loading libGLESv2 on startup. This is bad > because on platforms like Linux and Mac we could sometimes use the > incorrect rpath. This in turn meant we needed workarounds like using > "_angle" extensions to our shared objects to get the correct loading > behaviour. > > Fix this by loading libGLESv2 dynamically in libEGL. We build the > loader automatically from egl.xml. The loader itself is lazily > initialized on every EGL entry point call. This is necessary because > on Linux, etc, there is no equivalent to Windows' DLLMain. > > We also use an EGL.h with different generation options so we have the > proper function pointer types. A README is included for instructions > on how to regenerate EGL.h. > > The entry point generation script is refactored into a helper class > that is used in the loader generator. Also adds the libGLESv2 versions > of the EGL entry points in the DEF file on Windows. This allows them to > be imported properly in 32-bit configurations. > > Also fixes up some errors in ANGLE's entry point definitions. Also > includes a clang-format disable rule for the Khronos headers. > > This CL will help us to run ANGLE tests against native drivers. > > Bug: angleproject:2871 > Change-Id: Id6ecf969308f17b1be4083538428c9c1a1836572 > Reviewed-on: https://chromium-review.googlesource.com/c/1370725 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=ynovikov@chromium.org,geofflang@chromium.org,jmadill@chromium.org Change-Id: I921b3c45435ab4f05cbc2d1c1172b4185d6257b0 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2871 Reviewed-on: https://chromium-review.googlesource.com/c/1378887 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2018-12-16 22:53:23 +03:00
configs += [
":angle_common_config",
":debug_annotations_config",
]
deps = [
":xxhash",
]
public_deps = [
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
":angle_system_utils",
":angle_version",
":includes",
]
public_configs += [ ":angle_common_config" ]
all_dependent_configs = [ ":angle_release_asserts_config" ]
if (use_fuzzing_engine) {
all_dependent_configs += [ ":angle_disable_pool_alloc" ]
}
}
config("angle_image_util_config") {
include_dirs = [
"include",
"src",
]
}
angle_source_set("angle_image_util_headers") {
sources = libangle_image_util_headers
public_deps = [
":angle_common",
]
}
angle_static_library("angle_image_util") {
sources = libangle_image_util_sources
public_configs += [ ":angle_image_util_config" ]
public_deps = [
":angle_image_util_headers",
]
}
config("angle_gl_visibility_config") {
if (is_win) {
defines = [
"GL_APICALL=",
"GL_API=",
]
} else {
defines = [
"GL_APICALL=__attribute__((visibility(\"default\")))",
"GL_API=__attribute__((visibility(\"default\")))",
]
}
}
config("angle_gpu_info_util_config") {
include_dirs = [
"include",
"src",
]
}
angle_static_library("angle_gpu_info_util") {
public_configs += [
":angle_gpu_info_util_config",
":angle_backend_config",
]
public_deps = [
":angle_common",
]
sources = libangle_gpu_info_util_sources
deps = []
libs = []
defines = []
if (is_android) {
sources += [ "src/gpu_info_util/SystemInfo_android.cpp" ]
}
if (is_win) {
sources += libangle_gpu_info_util_win_sources
if (!angle_is_winuwp) {
libs += [ "setupapi.lib" ]
}
libs += [ "dxgi.lib" ]
}
if (is_linux || is_fuchsia) {
sources += libangle_gpu_info_util_linux_sources
if (use_x11) {
sources += libangle_gpu_info_util_x11_sources
deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ]
defines += [ "GPU_INFO_USE_X11" ]
libs += [
"X11",
"Xi",
"Xext",
]
}
}
if (use_libpci) {
sources += libangle_gpu_info_util_libpci_sources
defines += [ "GPU_INFO_USE_LIBPCI" ]
libs += [ "pci" ]
}
if (is_mac) {
sources += libangle_gpu_info_util_mac_sources
libs += [
"IOKit.framework",
"CoreFoundation.framework",
"CoreGraphics.framework",
Reland "Make Mac SystemInfo reflect the currently active GPU on dual GPU machines" This reverts commit 58940f67acd5b89f1c338b134a596864595fcdca. Reason for revert: pixel test failures have been triaged in Gold. Relanding. Original change's description: > Revert "Make Mac SystemInfo reflect the currently active GPU on dual GPU machines" > > This reverts commit 720a8bab0eca86e5b9b8c07c200a217fb2c65755. > > Reason for revert: pixel test failures per http://crbug.com/984780#c13 > > Original change's description: > > Make Mac SystemInfo reflect the currently active GPU on dual GPU machines > > > > Currently, the GetSystemInfo() function (in gpu_info_util/SystemInfo_mac.mm) > > on dual GPU Macs always updates the active GPU field of the SystemInfo > > instance to the first non-Intel GPU it finds. This change overrides the > > activeGPUIndex field of the SystemInfo instance to reflect the current GPU > > instead of the non-intel GPU. > > > > Bug: 985486, 984780, angleproject:3701 > > Change-Id: Ia93f38f4a2f7728c05e99c83a940722bd3808766 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1752334 > > Commit-Queue: Kenneth Russell <kbr@chromium.org> > > Reviewed-by: Zhenyao Mo <zmo@chromium.org> > > Reviewed-by: Kenneth Russell <kbr@chromium.org> > > TBR=zmo@chromium.org,geofflang@chromium.org,kbr@chromium.org,dakshidnani@google.com > > Change-Id: Iacf4b8433ac1aa4d30c51f08ddfc6489af440cc4 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 985486, 984780, angleproject:3701 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1757373 > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Bug: 985486, 984780, angleproject:3701 Change-Id: I8f2f26f68329a2826a92742c46471b8c092b36ed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1765963 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
2019-08-23 00:12:08 +03:00
"OpenGL.framework",
]
}
}
angle_source_set("angle_translator_headers") {
sources = angle_translator_exported_headers
public_deps = [
":includes",
]
}
angle_static_library("translator") {
sources = angle_translator_sources
defines = []
if (angle_enable_essl || use_fuzzing_engine) {
sources += angle_translator_essl_sources
defines += [ "ANGLE_ENABLE_ESSL" ]
}
if (angle_enable_glsl || use_fuzzing_engine) {
sources += angle_translator_glsl_sources
defines += [ "ANGLE_ENABLE_GLSL" ]
}
if (angle_enable_hlsl || use_fuzzing_engine) {
sources += angle_translator_hlsl_sources
defines += [ "ANGLE_ENABLE_HLSL" ]
Disable the HLSL code in Angle if it is not being used. We're only using the HLSL code in Windows so it's not necessary to compile and distribute it on other platforms. This adds a defined ANGLE_ENABLE_HLSL that can be checked in files that are used by non-HLSL code as well. Mostly the HLSL code is just not include by the build system. Details of the space savings (heavily truncated) Total change: -165717 bytes =========================== -606 - Source: angle/src/common/utilities.cpp -627 - Source: angle/src/compiler/translator/FlagStd140Structs.cpp -695 - Source: /usr/include/c++/4.8/bits/stl_algo.h -710 - Source: angle/src/compiler/translator/TranslatorHLSL.cpp -713 - Source: angle/src/compiler/translator/IntermNode.h -863 - Source: /usr/include/c++/4.8/bits/stl_map.h -935 - Source: angle/src/compiler/translator/blocklayout.cpp -1515 - Source: angle/src/compiler/translator/BuiltInFunctionEmulator.cpp -1655 - Source: angle/src/compiler/translator/UnfoldShortCircuit.cpp -2375 - Source: /usr/include/c++/4.8/bits/vector.tcc -3135 - Source: angle/src/compiler/translator/RewriteElseBlocks.cpp -4656 - Source: angle/src/compiler/translator/UtilsHLSL.cpp -5265 - Source: angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp -6505 - Source: /usr/include/c++/4.8/bits/stl_tree.h -11480 - Source: angle/src/compiler/translator/UniformHLSL.cpp -13580 - Source: angle/src/compiler/translator/StructureHLSL.cpp -18964 - Source: ?? (constant strings and a few vtbls) -89332 - Source: angle/src/compiler/translator/OutputHLSL.cpp Change-Id: I23ccc98abd0a21f847dd34f9482800b3ba679d56 Reviewed-on: https://chromium-review.googlesource.com/251528 Tested-by: bratell at Opera <bratell@opera.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
2015-02-25 16:34:49 +03:00
}
if (angle_enable_vulkan || use_fuzzing_engine) {
sources += angle_translator_lib_vulkan_sources
defines += [ "ANGLE_ENABLE_VULKAN" ]
}
public_configs += [ ":external_config" ]
deps = [
":includes",
":preprocessor",
]
public_deps = [
":angle_common",
":angle_translator_headers",
]
if (is_win) {
# Necessary to suppress some system header xtree warnigns in Release.
# For some reason this warning doesn't get triggered in Chromium
cflags = [ "/wd4718" ]
}
}
angle_source_set("translator_fuzzer") {
sources = [
"src/compiler/fuzz/translator_fuzzer.cpp",
]
include_dirs = [
"include",
"src",
]
deps = [
":translator",
]
}
config("commit_id_config") {
include_dirs = [ "$root_gen_dir/angle" ]
visibility = [ ":commit_id" ]
}
commit_id_output_file = "$root_gen_dir/angle/id/commit.h"
if (angle_use_commit_id) {
action("commit_id") {
script = "src/commit_id.py"
outputs = [
commit_id_output_file,
]
# commit id should depend on angle's HEAD revision
inputs = [
".git/HEAD",
]
args = [
"gen",
rebase_path(".", root_build_dir),
rebase_path(commit_id_output_file, root_build_dir),
]
public_configs = [ ":commit_id_config" ]
}
} else {
copy("commit_id") {
sources = [
"src/commit.h",
]
outputs = [
commit_id_output_file,
]
public_configs = [ ":commit_id_config" ]
}
}
angle_source_set("angle_version") {
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
sources = [
"src/common/version.h",
]
public_deps = [
":commit_id",
]
}
config("angle_backend_config") {
defines = []
if (angle_enable_d3d9) {
defines += [ "ANGLE_ENABLE_D3D9" ]
}
if (angle_enable_d3d11) {
defines += [ "ANGLE_ENABLE_D3D11" ]
}
if (angle_enable_gl) {
defines += [ "ANGLE_ENABLE_OPENGL" ]
if (angle_enable_gl_null) {
defines += [ "ANGLE_ENABLE_OPENGL_NULL" ]
}
}
if (angle_enable_null) {
defines += [ "ANGLE_ENABLE_NULL" ]
}
if (angle_enable_vulkan) {
configs = [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend_config" ]
}
}
config("libANGLE_config") {
cflags = []
defines = []
libs = []
ldflags = []
if (angle_enable_d3d9) {
ldflags += [ "/DELAYLOAD:d3d9.dll" ]
}
defines += [ "LIBANGLE_IMPLEMENTATION" ]
if (is_win) {
cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics are not enabled.
}
if (is_android && (angle_enable_gl || angle_enable_vulkan)) {
# In API level 26 ANativeWindow APIs were moved from libandroid.so
# into a separate library, libnativewindow.so
if (ndk_api_level_at_least_26) {
libs += [ "nativewindow" ]
} else {
libs += [ "android" ]
}
}
if (use_x11) {
defines += [ "ANGLE_USE_X11" ]
}
}
angle_source_set("libANGLE_headers") {
sources = libangle_headers
public_deps = [
":angle_common",
":angle_translator_headers",
]
}
angle_source_set("libANGLE_base") {
sources = libangle_sources
include_dirs = []
libs = []
defines = []
if (angle_link_glx) {
libs += [ "GL" ]
defines += [ "ANGLE_LINK_GLX" ]
}
public_deps = [
":angle_common",
":angle_gpu_info_util",
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
":angle_version",
":libANGLE_headers",
":translator",
]
deps = [
":angle_image_util",
":includes",
]
if (angle_enable_vulkan) {
public_deps += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend" ]
}
# Enable extra Chromium style warnings for libANGLE.
if (is_clang) {
suppressed_configs -= [ "//build/config/clang:find_bad_constructs" ]
}
# Shared D3D sources.
if (angle_enable_d3d9 || angle_enable_d3d11) {
sources += libangle_d3d_shared_sources
defines += [ "ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " + "\"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }" ]
}
if (angle_enable_d3d9) {
sources += libangle_d3d9_sources
libs += [ "d3d9.lib" ]
}
if (angle_enable_d3d11) {
sources += libangle_d3d11_sources
if (angle_is_winuwp) {
sources += libangle_d3d11_winuwp_sources
} else {
sources += libangle_d3d11_win32_sources
}
libs += [ "dxguid.lib" ]
import("src/libANGLE/renderer/d3d/d3d11/d3d11_blit_shaders_autogen.gni")
sources += libangle_d3d11_blit_shaders
}
if (angle_enable_gl) {
sources += libangle_gl_sources
include_dirs += [ "src/third_party/khronos" ]
if (angle_enable_gl_null) {
sources += libangle_gl_null_sources
}
if (is_win) {
sources += libangle_gl_wgl_sources
}
if (use_x11) {
sources += libangle_gl_glx_sources
deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ]
libs += [
"X11",
"Xi",
"Xext",
]
}
if (is_mac) {
sources += libangle_gl_cgl_sources
libs += [
"Cocoa.framework",
"IOSurface.framework",
"OpenGL.framework",
"QuartzCore.framework",
]
}
if (is_android) {
sources += libangle_gl_egl_sources
sources += libangle_gl_egl_dl_sources
sources += libangle_gl_egl_android_sources
}
if (ozone_platform_gbm) {
configs += [ ":libdrm" ]
defines += [ "ANGLE_USE_OZONE" ]
deps += [ "//third_party/minigbm" ]
sources += libangle_gl_egl_sources
sources += libangle_gl_egl_dl_sources
sources += libangle_gl_ozone_sources
}
}
if (angle_enable_null) {
sources += libangle_null_sources
}
if (is_mac) {
sources += libangle_mac_sources
}
if (is_debug) {
defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ]
}
Reland "Vulkan: Debug overlay" This is a reland of e54d0f90d1a165404236fd7abd1b05ddd041a686 This was reverted due to a build failure as a result of a missing virtual destructor in the widget base class. Original change's description: > Vulkan: Debug overlay > > A debug overlay system for the Vulkan backend designed with efficiency > and runtime configurability in mind. Overlay widgets are of two > fundamental types: > > - Text widgets: A single line of text with small, medium or large font. > - Graph widgets: A bar graph of data. > > Built on these, various overlay widget types are defined that gather > statistics. Five such types are defined with one widget per type as > example: > > - Count: A widget that counts something. VulkanValidationMessageCount > is an overlay widget of this type that shows the number of validation > messages received from the validation layers. > - Text: A generic text. VulkanLastValidationMessage is an overlay > widget of this type that shows the last validation message. > - PerSecond: A value that gets reset every second automatically. FPS is > an overlay widget of this type that simply gets incremented on every > swap(). > - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an > overlay of this type. On every vkQueueSubmit, the number of nodes in > the command graph is accumulated. On every present(), the value is > taken as the number of nodes for the whole duration of the frame. > - RunningHistogram: A histogram of last N values. Input values are in > the [0, 1] range and they are ranked to N buckets for histogram > calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay > widget of this type. On vkQueueSubmit, the memory waste from command > buffer pool allocations is recorded in the histogram. > > Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py > processes to create an array of bits, which is processed at runtime to > create the actual font image (an image with 3 layers). > > The overlay widget layout is defined in overlay_widgets.json which > gen_overlay_widgets.py processes to generate an array of widgetss, each > of its respective type, and sets their properties, such as color and > bounding box. The json file allows widgets to align against other > widgets as well as against the framebuffer edges. > > Two compute shaders are implemented to efficiently render the UI: > > - OverlayCull: This shader creates a bitset of Text and Graph widgets > whose bounding boxes intersect a corresponding subgroup processed by > OverlayDraw. This is done only when the enabled overlay widgets are > changed (a feature that is not yet implemented) or the surface is > resized. > - OverlayDraw: Using the bitsets generated by OverlayCull, values that > are uniform for each workgroup (set to be equal to hardware subgroup > size), this shader loops over enabled widgets that can possibly > intersect the pixel being processed and renders and blends in texts > and graphs. This is done once per frame on present(). > > Currently, to enable overlay widgets an environment variable is used. > For example: > > $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste > $ ./hello_triangle --use-angle=vulkan > > Possible future work: > > - On Android, add settings in developer options and enable widgets based > on those. > - Spawn a small server in ANGLE and write an application that sends > enable/disable commands remotely. > - Implement overlay for other backends. > > Bug: angleproject:3757 > Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:3757 Change-Id: I47915d88b37b6f882c686c2de13fca309a10b572 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1780897 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2019-06-30 10:26:18 +03:00
if (angle_enable_overlay) {
defines += [ "ANGLE_ENABLE_OVERLAY=1" ]
}
configs += [ ":debug_annotations_config" ]
public_configs += [
":libANGLE_config",
":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 (is_win && target_cpu != "arm64") {
data_deps = [
":copy_compiler_dll",
]
}
}
config("angle_frame_capture_disabled") {
defines = [ "ANGLE_CAPTURE_ENABLED=0" ]
}
config("angle_frame_capture_enabled") {
defines = [ "ANGLE_CAPTURE_ENABLED=1" ]
}
angle_source_set("libANGLE") {
public_deps = [
":libANGLE_base",
]
public_configs = [ ":angle_frame_capture_disabled" ]
sources = [
"src/libANGLE/FrameCapture_mock.cpp",
]
# gl_enum_utils defaults included in with_capture build
if (angle_enable_trace || is_debug) {
sources += [ "src/libANGLE/gl_enum_utils_autogen.cpp" ]
}
}
angle_source_set("libANGLE_with_capture") {
public_deps = [
":libANGLE_base",
]
public_configs = [ ":angle_frame_capture_enabled" ]
sources = libangle_capture_sources
}
config("shared_library_public_config") {
if (is_mac && !is_component_build) {
# Executable targets that depend on the shared libraries below need to have
# the rpath setup in non-component build configurations.
ldflags = [
"-rpath",
"@executable_path/",
]
}
}
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
config("library_name_config") {
defines = [
"ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}\"",
"ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}\"",
]
}
# This config controls export definitions on ANGLE API calls.
config("angle_static") {
defines = [
"ANGLE_EXPORT=",
"ANGLE_UTIL_EXPORT=",
"EGLAPI=",
"GL_APICALL=",
"GL_API=",
]
}
set_defaults("angle_libGLESv2") {
sources = []
output_name = "libGLESv2"
}
template("angle_libGLESv2") {
angle_shared_library(target_name) {
sources = libglesv2_sources + invoker.sources
if (is_win) {
sources += [ "src/libGLESv2/${invoker.output_name}_autogen.def" ]
}
output_name = "${invoker.output_name}${angle_libs_suffix}"
configs += [
":angle_gl_visibility_config",
":debug_annotations_config",
":gl_prototypes",
]
defines = [ "LIBGLESV2_IMPLEMENTATION" ]
deps = invoker.deps + [ ":includes" ]
public_deps = [
":angle_version",
]
}
}
angle_libGLESv2("libGLESv2") {
if (angle_with_capture_by_default) {
deps = [
":libANGLE_with_capture",
]
} else {
deps = [
":libANGLE",
]
}
}
# Output capture lib when `angle_with_capture_by_default` disabled, vice versa.
angle_libGLESv2("libGLESv2_capture_complement") {
if (angle_with_capture_by_default) {
deps = [
":libANGLE",
]
output_name += "_no_capture"
} else {
deps = [
":libANGLE_with_capture",
]
output_name += "_with_capture"
}
}
if (is_win && !angle_is_winuwp) {
angle_shared_library("libGL") {
sources = libgl_sources
output_name = "openGL32"
output_dir = "$root_out_dir/angle_libs"
configs += [
":angle_gl_visibility_config",
":debug_annotations_config",
":gl_prototypes",
]
defines = [
"ANGLE_CAPTURE_ENABLED=0",
"LIBGL_IMPLEMENTATION",
]
deps = [
":includes",
":libANGLE",
]
public_deps = [
":angle_version",
]
}
}
angle_static_library("libGLESv2_static") {
sources = libglesv2_sources
configs += [ ":debug_annotations_config" ]
public_configs += [ ":angle_static" ]
deps = [
":includes",
]
public_deps = [
":libANGLE",
]
}
angle_shared_library("libGLESv1_CM") {
sources = libglesv1_cm_sources
output_name = "libGLESv1_CM${angle_libs_suffix}"
configs += [
":angle_gl_visibility_config",
":debug_annotations_config",
":gl_prototypes",
]
defines = []
deps = [
":includes",
":libGLESv2",
]
}
angle_static_library("libGLESv1_CM_static") {
sources = libglesv1_cm_sources
configs += [ ":debug_annotations_config" ]
public_configs += [ ":angle_static" ]
deps = [
":includes",
":libGLESv2_static",
]
}
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
config("libEGL_egl_loader_config") {
defines = [ "ANGLE_USE_EGL_LOADER" ]
}
angle_source_set("libEGL_egl_loader") {
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
sources = [
"src/libEGL/egl_loader_autogen.cpp",
"src/libEGL/egl_loader_autogen.h",
]
public_configs += [
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
":libEGL_egl_loader_config",
":gl_prototypes",
]
deps = [
":includes",
]
}
angle_shared_library("libEGL") {
sources = libegl_sources
output_name = "libEGL${angle_libs_suffix}"
configs += [
":debug_annotations_config",
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
":library_name_config",
]
defines = [ "LIBEGL_IMPLEMENTATION" ]
if (is_win) {
defines += [ "EGLAPI=" ]
} else {
defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ]
}
if (is_win) {
sources += [ "src/libEGL/libEGL.def" ]
}
deps = [
":angle_common",
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
":angle_system_utils",
":angle_version",
":libEGL_egl_loader",
]
public_deps = [
":includes",
]
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
data_deps = [
":libGLESv2",
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
]
}
angle_static_library("libEGL_static") {
sources = libegl_sources
configs += [
":debug_annotations_config",
Re-land "Load correct libGLESv2 on Linux and Mac." Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-17 21:13:49 +03:00
":library_name_config",
]
public_configs += [ ":angle_static" ]
deps = [
":includes",
":libGLESv2_static",
]
}
import("util/util.gni")
config("angle_util_loader_config") {
defines = [ "ANGLE_USE_UTIL_LOADER" ]
}
angle_source_set("angle_util_loader_headers") {
sources = [
"util/egl_loader_autogen.h",
"util/gles_loader_autogen.h",
"util/util_export.h",
]
if (is_win && !angle_is_winuwp) {
sources += [ "util/windows/wgl_loader_autogen.h" ]
}
public_deps = [
":includes",
]
}
angle_source_set("angle_util_loader") {
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
sources = [
"util/egl_loader_autogen.cpp",
"util/gles_loader_autogen.cpp",
]
if (is_win && !angle_is_winuwp) {
sources += [ "util/windows/wgl_loader_autogen.cpp" ]
}
deps = [
":angle_util_loader_headers",
]
public_configs += [
":angle_util_config",
":angle_util_loader_config",
":no_gl_prototypes",
]
}
config("angle_util_config") {
include_dirs = [ "." ]
if (is_linux && use_x11) {
libs = [ "X11" ]
}
}
foreach(is_shared_library,
[
true,
false,
]) {
if (is_shared_library) {
library_type = "angle_shared_library"
library_name = "angle_util"
dep_suffix = "${angle_libs_suffix}"
} else {
library_type = "angle_static_library"
library_name = "angle_util_static"
dep_suffix = "_static"
}
target(library_type, library_name) {
sources = util_sources
deps = [
":angle_common",
":angle_util_loader_headers",
]
public_deps = []
libs = []
if (is_win && !angle_is_winuwp) {
sources += util_win_sources
deps += [ ":angle_stack_walker" ]
}
if (is_linux) {
sources += util_linux_sources
libs += [
"rt",
"dl",
]
}
if (is_mac) {
sources += util_osx_sources
libs += [
"AppKit.framework",
"QuartzCore.framework",
]
}
if (use_x11) {
sources += util_x11_sources
}
if (is_android) {
# To prevent linux sources filtering on android
set_sources_assignment_filter([])
sources += util_android_sources
libs += [
"android",
"log",
]
}
configs += [ ":debug_annotations_config" ]
public_configs += [ ":angle_util_config" ]
if (is_fuchsia) {
sources += util_fuchsia_sources
public_deps += [
"$angle_root/src/common/fuchsia_egl",
"src/libANGLE/renderer/vulkan:angle_vulkan",
"//third_party/fuchsia-sdk/sdk:async_loop_cpp",
"//third_party/fuchsia-sdk/sdk:async_loop_default",
"//third_party/fuchsia-sdk/sdk:fdio",
"//third_party/fuchsia-sdk/sdk:images",
"//third_party/fuchsia-sdk/sdk:scenic_cpp",
"//third_party/fuchsia-sdk/sdk:ui_policy",
"//third_party/fuchsia-sdk/sdk:ui_scenic",
"//third_party/fuchsia-sdk/sdk:ui_views",
]
} else if (use_ozone) {
sources += util_ozone_sources
}
if (is_shared_library) {
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
if (is_win && !angle_is_winuwp) {
sources += util_win_shared_sources
}
public_deps += [ ":angle_util_loader" ]
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/libangle_util.dylib",
]
}
} else {
public_configs += [
":angle_static",
":gl_prototypes",
]
}
}
}
# Convenience targets for some of the samples so they can be built
# with Chromium's toolchain.
angle_executable("angle_shader_translator") {
testonly = true
sources = [
"samples/shader_translator/shader_translator.cpp",
]
deps = [
":translator",
]
}
config("angle_feature_support_config") {
include_dirs = [
"include",
"src",
]
defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ]
if (is_debug) {
defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ]
}
}
angle_shared_library("libfeature_support") {
output_name = "libfeature_support${angle_libs_suffix}"
if (is_android) {
libs = [ "log" ]
}
public_configs += [
":angle_feature_support_config",
"${angle_jsoncpp_dir}:jsoncpp_config",
]
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/${target_name}.dylib",
]
}
sources = [
"src/feature_support_util/feature_support_util.cpp",
"src/feature_support_util/feature_support_util.h",
]
deps = [
":angle_gpu_info_util",
"${angle_jsoncpp_dir}:jsoncpp",
]
}
if (!is_component_build && is_android && symbol_level != 0) {
action_foreach("compressed_symbols") {
sources = []
foreach(_library, angle_libraries) {
sources += [ "$root_out_dir/${_library}${angle_libs_suffix}.so" ]
}
if (angle_enable_vulkan_validation_layers) {
foreach(_layer, vulkan_validation_layers) {
sources += [ "$root_out_dir/lib${_layer}.so" ]
}
}
script = rebase_path("${root_build_dir}/android/compress_symbols.py",
root_build_dir)
deps = []
foreach(_library, angle_libraries) {
deps += [ ":$_library" ]
}
if (angle_enable_vulkan_validation_layers) {
foreach(_layer, vulkan_validation_layers) {
Reland "Vulkan: Use VK repos' internal BUILD.gn files" This is a reland of 552f5fcb0d8fcc615856ce3b678190e1cbdd38e6 There was a missing build dependence causing a build no-op issue which has now been fixed in the upstream Vulkan Validation Layer repo. Primary workaround that need to be re-visted and fixed are: 1. Disabled validation layers on 32-bit Windows 2. Disabled validation layers on 32-bit Android 3. Disabled DebugUtils on Android, using DebugReport instead 4. Using custom VK Loader branch to avoid WDK dependence Original change's description: > Vulkan: Use VK repos' internal BUILD.gn files > > This retires custom BUILD.gn files for the Vulkan Headers, Tools, > Validation-Layers, and Loader repos. They now have integrated BUILD.gn > files so switched ANGLE to use those by default. > Also Validation Layer, Loader, and Tools repos no longer uses codegen > so this speeds up the build overall. > Switched over from old VK_LAYER_LUNARG_standard_validation meta-layer > to VK_LAYER_KHRONOS_validation unified layer. > > This changes includes a temporary workaround to the Vulkan-Loader repo > to remove its Window's build dependence on WDK. There are plans to > remove that depenedence in Loader master, but until then we can use > our custom branch workaround. > It also includes a custom branch for validation layers that includes > some build fixes for ANGLE. > Finally, the layers were crashing on Android when attempting to use > DebugUtils extension so forcing DebugReport on Android for now. > > Bug: angleproject:2449 > Bug: angleproject:3320 > Bug: angleproject:3852 > Bug: angleproject:3924 > Bug: angleproject:3925 > Bug: angleproject:3946 > Bug: chromium:997009 > Bug: chromium:997016 > Change-Id: I48b36acefcc7f2bc930eb72d6fdbc87bca24f833 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610438 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Tobin Ehlis <tobine@google.com> Bug: angleproject:2449, angleproject:3320, angleproject:3852 Change-Id: I373ada091a1329db5e304874079428d01ba21d52 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1778302 Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
2019-07-19 00:10:49 +03:00
deps += [
"${angle_root}/third_party/vulkan-validation-layers/src:${_layer}",
]
}
}
outputs = [
"$root_out_dir/lib.compressed/{{source_file_part}}",
]
android_nm = "${android_tool_prefix}nm"
android_strip = "${android_tool_prefix}strip"
args = [
"--objcopy",
rebase_path(android_objcopy, root_build_dir),
"--nm",
rebase_path(android_nm, root_build_dir),
"--strip",
rebase_path(android_strip, root_build_dir),
"--unstrippedsofile",
"{{source_dir}}/lib.unstripped/{{source_file_part}}",
"--output",
"{{source_dir}}/lib.compressed/{{source_file_part}}",
]
}
}
if (!is_component_build && is_android &&
current_toolchain == default_toolchain) {
# Package ANGLE libraries
angle_apk("angle_chromium_apk") {
package_name = "com.chromium.angle"
Reland "Create Container ANGLE APK" This reverts commit 902ceed3998617e97aad25d6b632f9e34dff2644. Reason for revert: Re-landing this since the Chromium build fix has landed: https://bugs.chromium.org/p/chromium/issues/detail?id=933783#c29 Comment 29 by gbeaty@chromium.org, Today (13 minutes ago) Tim, you should be able to re-land your change now. Original change's description: > Revert "Create Container ANGLE APK" > > This reverts commit e82c857d38549da44de2c055e9e677a368e8793f. > > Reason for revert: > This is breaking the ANGLE build in the Chromium build process: > > https://bugs.chromium.org/p/chromium/issues/detail?id=933783#c6 > > Original change's description: > > Create Container ANGLE APK > > > > The ANGLE APK needs to be reverted back to just being a container > > for the ANGLE shared object libraries, since the rest of the APK > > contents are in the Android source tree. > > > > Bug: angleproject:3154 > > Test: 'adb sync' the APK on to a device > > Change-Id: Id245f1e3d269c71054d9759e8ba8be0532afe659 > > Reviewed-on: https://chromium-review.googlesource.com/c/1474341 > > Commit-Queue: Tim Van Patten <timvp@google.com> > > Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> > > TBR=ynovikov@chromium.org,jmadill@google.com,cnorthrop@google.com,courtneygo@google.com,timvp@google.com > > Change-Id: I71a739faa2052a707a06bce616ab43a621d5a4ff > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: angleproject:3154 > Reviewed-on: https://chromium-review.googlesource.com/c/1478333 > Reviewed-by: Tim Van Patten <timvp@google.com> > Commit-Queue: Tim Van Patten <timvp@google.com> TBR=ynovikov@chromium.org,jmadill@google.com,cnorthrop@google.com,courtneygo@google.com,timvp@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:3154 Change-Id: If3a9abfb1c00aab3278437a233bef29d5febe5a5 Reviewed-on: https://chromium-review.googlesource.com/c/1480865 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
2019-02-21 22:21:09 +03:00
apk_name = "AngleLibraries"
}
group("angle_apks") {
deps = [
":angle_chromium_apk",
]
}
}