Revert "Isolate commit_id.h from other code."

This reverts commit 6d7ebf656d.

Reason for revert: Suspected reason for failing ANGLE roll into Chromium

Original change's description:
> Isolate commit_id.h from other code.
>
> Instead of recompiling multiple source files, we can seal off the
> files that include commit_id to prevent recompilations when the
> commit changes and source files don't change.
>
> Bug: angleproject:2551
> Change-Id: I98800c5a8e04ec7d4c3e57ea0eb3b636d3b224bb
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3212895
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>

Bug: angleproject:2551
Bug: angleproject:6588
Change-Id: I19f41141f57d0683efb9a4ec043e078a9f7dc925
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3226056
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This commit is contained in:
Shahbaz Youssefi 2021-10-19 14:07:07 +00:00
Родитель 7fea17b972
Коммит 7defdb6044
15 изменённых файлов: 50 добавлений и 130 удалений

Просмотреть файл

@ -376,6 +376,7 @@ angle_static_library("angle_common") {
public_deps = [
":angle_abseil",
":angle_version",
":includes",
]
public_configs += [ ":angle_common_config" ]
@ -662,12 +663,10 @@ config("angle_commit_id_config") {
visibility = [ ":angle_commit_id" ]
}
_commit_id_output_file = "$root_gen_dir/angle/angle_commit.h"
action("angle_commit_id") {
_commit_id_header = "$root_gen_dir/angle/angle_commit.h"
script = "src/commit_id.py"
outputs = [ _commit_id_header ]
visibility = [ ":angle_version" ]
outputs = [ _commit_id_output_file ]
# Add git as a dependency if it is available.
if (angle_enable_commit_id &&
@ -693,7 +692,7 @@ action("angle_commit_id") {
args = [
"gen",
rebase_path(_commit_id_header, root_build_dir),
rebase_path(_commit_id_output_file, root_build_dir),
]
public_configs = [ ":angle_commit_id_config" ]
@ -702,30 +701,6 @@ action("angle_commit_id") {
angle_source_set("angle_version") {
sources = [ "src/common/angle_version.h" ]
public_deps = [ ":angle_commit_id" ]
visibility = [
":angle_version_info",
":libEGL",
":libGL",
":libGLESv1_CM",
":libGLESv2",
":libGLESv2_capture_complement",
]
# TODO(jmadill): Remove once headers isolated. http://anglebug.com/2551
if (build_with_chromium) {
visibility += [
"//content/browser:browser",
"//gpu/command_buffer/service:gles2_sources",
]
}
}
angle_source_set("angle_version_info") {
sources = [
"src/common/angle_version_info.cpp",
"src/common/angle_version_info.h",
]
deps = [ ":angle_version" ]
}
config("angle_backend_config") {
@ -879,7 +854,7 @@ angle_source_set("libANGLE_base") {
public_deps = [
":angle_common",
":angle_gpu_info_util",
":angle_version_info",
":angle_version",
":libANGLE_headers",
":translator",
]
@ -1142,11 +1117,9 @@ template("angle_libGLESv2") {
if (angle_enable_cl) {
sources += libglesv2_cl_sources
}
if (is_win) {
sources += [
"src/libGLESv2/${invoker.output_name}_autogen.def",
"src/libGLESv2/libGLESv2.rc",
]
sources += [ "src/libGLESv2/${invoker.output_name}_autogen.def" ]
}
output_name = "${invoker.output_name}${angle_libs_suffix}"
@ -1159,10 +1132,9 @@ template("angle_libGLESv2") {
defines = [ "LIBGLESV2_IMPLEMENTATION" ]
deps = invoker.deps + [
":angle_version",
":includes",
]
deps = invoker.deps + [ ":includes" ]
public_deps = [ ":angle_version" ]
}
}
@ -1206,10 +1178,11 @@ if (is_win && !angle_is_winuwp) {
]
deps = [
":angle_version",
":includes",
":libANGLE",
]
public_deps = [ ":angle_version" ]
}
}
@ -1238,7 +1211,6 @@ angle_shared_library("libGLESv1_CM") {
defines = []
deps = [
":angle_version",
":includes",
":libGLESv2",
]
@ -1268,10 +1240,6 @@ angle_source_set("libEGL_egl_loader") {
angle_shared_library("libEGL") {
sources = libegl_sources
if (is_win) {
sources += [ "src/libEGL/libEGL.rc" ]
}
output_name = "libEGL${angle_libs_suffix}"
configs += [

Просмотреть файл

@ -1,31 +0,0 @@
//
// Copyright 2021 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.
//
// angle_version_info.cpp: ANGLE version queries.
#include "common/angle_version.h"
namespace angle
{
int GetANGLERevision()
{
return ANGLE_REVISION;
}
const char *GetANGLEVersionString()
{
return ANGLE_VERSION_STRING;
}
const char *GetANGLECommitHash()
{
return ANGLE_COMMIT_HASH;
}
int GetANGLECommitHashSize()
{
return ANGLE_COMMIT_HASH_SIZE;
}
} // namespace angle

Просмотреть файл

@ -1,19 +0,0 @@
//
// Copyright 2021 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.
//
// angle_version_info.h: ANGLE version queries.
#ifndef COMMON_VERSION_H_
#define COMMON_VERSION_H_
namespace angle
{
int GetANGLERevision();
const char *GetANGLEVersionString();
const char *GetANGLECommitHash();
int GetANGLECommitHashSize();
} // namespace angle
#endif // COMMON_VERSION_H_

Просмотреть файл

@ -15,7 +15,7 @@
#include <vector>
#include "common/PackedEnums.h"
#include "common/angle_version_info.h"
#include "common/angle_version.h"
#include "common/matrix_utils.h"
#include "common/platform.h"
#include "common/system_utils.h"
@ -3210,7 +3210,7 @@ void Context::initVersionStrings()
versionString << "OpenGL ES ";
}
versionString << clientVersion.major << "." << clientVersion.minor << ".0 (ANGLE "
<< angle::GetANGLEVersionString() << ")";
<< ANGLE_VERSION_STRING << ")";
mVersionString = MakeStaticString(versionString.str());
std::ostringstream shadingLanguageVersionString;
@ -3224,8 +3224,8 @@ void Context::initVersionStrings()
shadingLanguageVersionString << "OpenGL GLSL ";
}
shadingLanguageVersionString << (clientVersion.major == 2 ? 1 : clientVersion.major) << "."
<< clientVersion.minor << "0 (ANGLE "
<< angle::GetANGLEVersionString() << ")";
<< clientVersion.minor << "0 (ANGLE " << ANGLE_VERSION_STRING
<< ")";
mShadingLanguageString = MakeStaticString(shadingLanguageVersionString.str());
}

Просмотреть файл

@ -16,7 +16,7 @@
#include <GLSLANG/ShaderVars.h>
#include <anglebase/sha1.h>
#include "common/angle_version_info.h"
#include "common/angle_version.h"
#include "common/utilities.h"
#include "libANGLE/BinaryStream.h"
#include "libANGLE/Context.h"
@ -116,7 +116,7 @@ void MemoryProgramCache::ComputeHash(const Context *context,
}
// Add some ANGLE metadata and Context properties, such as version and back-end.
hashStream << angle::GetANGLECommitHash() << context->getClientMajorVersion()
hashStream << ANGLE_COMMIT_HASH << context->getClientMajorVersion()
<< context->getClientMinorVersion() << context->getString(GL_RENDERER);
// Hash pre-link program properties.

Просмотреть файл

@ -12,7 +12,7 @@
#include <algorithm>
#include <utility>
#include "common/angle_version_info.h"
#include "common/angle_version.h"
#include "common/bitset_utils.h"
#include "common/debug.h"
#include "common/platform.h"
@ -4635,8 +4635,8 @@ angle::Result Program::serialize(const Context *context, angle::MemoryBuffer *bi
{
BinaryOutputStream stream;
stream.writeBytes(reinterpret_cast<const unsigned char *>(angle::GetANGLECommitHash()),
angle::GetANGLECommitHashSize());
stream.writeBytes(reinterpret_cast<const unsigned char *>(ANGLE_COMMIT_HASH),
ANGLE_COMMIT_HASH_SIZE);
// nullptr context is supported when computing binary length.
if (context)
@ -4716,7 +4716,7 @@ angle::Result Program::serialize(const Context *context, angle::MemoryBuffer *bi
}
else
{
// If we don't have an attached shader, which would occur if this program was
// If we dont have an attached shader, which would occur if this program was
// created via glProgramBinary, pull from our cached copy
const angle::ProgramSources &cachedLinkedSources =
context->getShareGroup()->getFrameCaptureShared()->getProgramSources(id());
@ -4744,9 +4744,10 @@ angle::Result Program::deserialize(const Context *context,
BinaryInputStream &stream,
InfoLog &infoLog)
{
std::vector<uint8_t> commitString(angle::GetANGLECommitHashSize(), 0);
stream.readBytes(commitString.data(), commitString.size());
if (memcmp(commitString.data(), angle::GetANGLECommitHash(), commitString.size()) != 0)
unsigned char commitString[ANGLE_COMMIT_HASH_SIZE];
stream.readBytes(commitString, ANGLE_COMMIT_HASH_SIZE);
if (memcmp(commitString, ANGLE_COMMIT_HASH, sizeof(unsigned char) * ANGLE_COMMIT_HASH_SIZE) !=
0)
{
infoLog << "Invalid program binary version.";
return angle::Result::Stop;

Просмотреть файл

@ -16,7 +16,7 @@
#include "sys/stat.h"
#include "common/angle_version_info.h"
#include "common/angle_version.h"
#include "common/mathutil.h"
#include "common/serializer/JsonSerializer.h"
#include "common/string_utils.h"
@ -6034,7 +6034,7 @@ void FrameCaptureShared::writeCppReplayIndexFiles(const gl::Context *context,
JsonSerializer json;
json.startGroup("TraceMetadata");
json.addScalar("CaptureRevision", GetANGLERevision());
json.addScalar("CaptureRevision", ANGLE_REVISION);
json.addScalar("ContextClientMajorVersion", context->getClientMajorVersion());
json.addScalar("ContextClientMinorVersion", context->getClientMinorVersion());
json.addHexValue("DisplayPlatformType", displayAttribs.getAsInt(EGL_PLATFORM_ANGLE_TYPE_ANGLE));

Просмотреть файл

@ -40,7 +40,6 @@ angle_source_set("angle_cl_backend") {
sources = _cl_backend_sources
public_deps = [
"$angle_root:angle_version_info",
"$angle_root:libANGLE_headers",
"$angle_root/third_party/OpenCL-ICD-Loader:opencl_icd_loader",
]

Просмотреть файл

@ -7,14 +7,16 @@
#include "libANGLE/renderer/cl/CLPlatformCL.h"
#include "common/angle_version_info.h"
#include "libANGLE/CLContext.h"
#include "libANGLE/CLDevice.h"
#include "libANGLE/CLPlatform.h"
#include "libANGLE/renderer/cl/CLContextCL.h"
#include "libANGLE/renderer/cl/CLDeviceCL.h"
#include "libANGLE/renderer/cl/cl_util.h"
#include "libANGLE/CLContext.h"
#include "libANGLE/CLDevice.h"
#include "libANGLE/CLPlatform.h"
#include "common/angle_version.h"
extern "C" {
#include "icd.h"
} // extern "C"
@ -171,7 +173,7 @@ CLPlatformImpl::Info CLPlatformCL::createInfo() const
}
// Customize version string and name
info.versionStr += std::string(" (ANGLE ") + angle::GetANGLEVersionString() + ")";
info.versionStr += " (ANGLE " ANGLE_VERSION_STRING ")";
info.name.insert(0u, "ANGLE pass-through -> ");
if (version >= CL_MAKE_VERSION(2, 1, 0) &&

Просмотреть файл

@ -264,10 +264,6 @@ angle_source_set("angle_vulkan_backend") {
"$angle_spirv_headers_dir:spv_headers",
]
if (angle_enable_cl || is_android) {
deps += [ "$angle_root:angle_version_info" ]
}
public_deps = [
"$angle_root:angle_glslang_wrapper",
"$angle_root:libANGLE_headers",

Просмотреть файл

@ -12,7 +12,7 @@
#include "libANGLE/CLPlatform.h"
#include "anglebase/no_destructor.h"
#include "common/angle_version_info.h"
#include "common/angle_version.h"
namespace rx
{
@ -98,8 +98,7 @@ const std::string &CLPlatformVk::GetVersionString()
{
static const angle::base::NoDestructor<const std::string> sVersion(
"OpenCL " + std::to_string(CL_VERSION_MAJOR(GetVersion())) + "." +
std::to_string(CL_VERSION_MINOR(GetVersion())) + " ANGLE " +
angle::GetANGLEVersionString());
std::to_string(CL_VERSION_MINOR(GetVersion())) + " ANGLE " ANGLE_VERSION_STRING);
return *sVersion;
}

Просмотреть файл

@ -13,7 +13,7 @@
#include <android/native_window.h>
#include <vulkan/vulkan.h>
#include "common/angle_version_info.h"
#include "common/angle_version.h"
#include "libANGLE/renderer/driver_utils.h"
#include "libANGLE/renderer/vulkan/RendererVk.h"
#include "libANGLE/renderer/vulkan/android/HardwareBufferImageSiblingVkAndroid.h"
@ -30,7 +30,7 @@ egl::Error DisplayVkAndroid::initialize(egl::Display *display)
ANGLE_TRY(DisplayVk::initialize(display));
std::stringstream strstr;
strstr << "Version (" << angle::GetANGLEVersionString() << "), ";
strstr << "Version (" << ANGLE_VERSION_STRING << "), ";
strstr << "Renderer (" << mRenderer->getRendererDescription() << ")";
__android_log_print(ANDROID_LOG_INFO, "ANGLE", "%s", strstr.str().c_str());

Просмотреть файл

@ -7,6 +7,7 @@
#include "entry_points_wgl.h"
#include "common/angle_version.h"
#include "common/debug.h"
#include "common/event_tracer.h"
#include "common/utilities.h"

Просмотреть файл

@ -626,6 +626,10 @@ libglesv2_cl_sources = [
"src/libGLESv2/proc_table_cl_autogen.cpp",
]
if (is_win) {
libglesv2_sources += [ "src/libGLESv2/libGLESv2.rc" ]
}
libglesv1_cm_sources = [
"src/libGLESv1_CM/libGLESv1_CM.cpp",
"src/libGLESv1_CM/resource.h",
@ -642,3 +646,7 @@ libegl_sources = [
"src/libGLESv2/entry_points_egl_autogen.h",
"src/libGLESv2/entry_points_egl_ext_autogen.h",
]
if (is_win) {
libegl_sources += [ "src/libEGL/libEGL.rc" ]
}

Просмотреть файл

@ -8,7 +8,7 @@
#include "libGLESv2/egl_stubs_autogen.h"
#include "common/angle_version_info.h"
#include "common/angle_version.h"
#include "libANGLE/Context.h"
#include "libANGLE/Display.h"
#include "libANGLE/EGLSync.h"
@ -534,12 +534,8 @@ const char *QueryString(Thread *thread, Display *display, EGLint name)
result = display->getVendorString().c_str();
break;
case EGL_VERSION:
{
static const char *sVersionString =
MakeStaticString(std::string("1.5 (ANGLE ") + angle::GetANGLEVersionString() + ")");
result = sVersionString;
result = "1.5 (ANGLE " ANGLE_VERSION_STRING ")";
break;
}
default:
UNREACHABLE();
break;