Commit b36f7a25 by Kevin Schoedel Committed by Commit Bot

Update gpu_test_expectations

Sync with chromium, primarily to shave the kOsFuchsia yak. Bug: angleproject:2475 Change-Id: I76ce607095d02e805a41f63315b4237e57f1cc4e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1497392 Commit-Queue: Jamie Madill <jmadill@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@google.com>
parent e3981cf7
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/HowToMakeChanges.md gpu_test_expectations/HowToMakeChanges.md
diff -rupN gpu_test_expectations_reverted/HowToMakeChanges.md gpu_test_expectations/HowToMakeChanges.md
--- gpu_test_expectations_reverted/HowToMakeChanges.md 1969-12-31 19:00:00.000000000 -0500
+++ gpu_test_expectations/HowToMakeChanges.md 2018-01-29 15:28:13.820679300 -0500
+++ gpu_test_expectations/HowToMakeChanges.md 2019-03-01 12:39:56.425160847 -0500
@@ -0,0 +1,22 @@
+Because the ```gpu_test_expectations``` directory is based on parts of Chromium's ```gpu/config```
+directory, we want to keep a patch of the changes added to make it compile with ANGLE. This
......@@ -24,10 +24,10 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/HowToMakeChanges.m
+ * ```git diff HEAD~ (`)ls(`) > angle-mods.patch```,```git add angle-mods.patch```, ```git commit --amend```
+ * ```git rebase -i``` to squash the three patches into one.
+
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/angle_config.h gpu_test_expectations/angle_config.h
diff -rupN gpu_test_expectations_reverted/angle_config.h gpu_test_expectations/angle_config.h
--- gpu_test_expectations_reverted/angle_config.h 1969-12-31 19:00:00.000000000 -0500
+++ gpu_test_expectations/angle_config.h 2017-09-11 17:09:26.892352900 -0400
@@ -0,0 +1,73 @@
+++ gpu_test_expectations/angle_config.h 2019-03-01 14:22:15.015379305 -0500
@@ -0,0 +1,74 @@
+//
+// Copyright 2015 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
......@@ -47,10 +47,11 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/angle_config.h gpu
+#include "common/debug.h"
+#include "common/string_utils.h"
+
+#define DCHECK_EQ(A,B) ASSERT((A) == (B))
+#define DCHECK_NE(A,B) ASSERT((A) != (B))
+#define DCHECK_EQ(A, B) ASSERT((A) == (B))
+#define DCHECK_NE(A, B) ASSERT((A) != (B))
+#define DCHECK(X) ASSERT(X)
+#define DLOG(X) std::cerr
+#define DVLOG(X) std::cerr
+#define LOG(X) std::cerr
+
+#define GPU_EXPORT
......@@ -58,32 +59,32 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/angle_config.h gpu
+// Shim Chromium's types by importing symbols in the correct namespaces
+namespace base
+{
+ using angle::kWhitespaceASCII;
+ using angle::TRIM_WHITESPACE;
+ using angle::KEEP_WHITESPACE;
+ using angle::SPLIT_WANT_ALL;
+ using angle::SPLIT_WANT_NONEMPTY;
+ using angle::SplitString;
+ using angle::SplitStringAlongWhitespace;
+ using angle::HexStringToUInt;
+ using angle::ReadFileToString;
+
+ using TimeDelta = int;
+using angle::HexStringToUInt;
+using angle::KEEP_WHITESPACE;
+using angle::kWhitespaceASCII;
+using angle::ReadFileToString;
+using angle::SPLIT_WANT_ALL;
+using angle::SPLIT_WANT_NONEMPTY;
+using angle::SplitString;
+using angle::SplitStringAlongWhitespace;
+using angle::TRIM_WHITESPACE;
+
+using TimeDelta = int;
+} // namespace base
+
+namespace gfx
+{
+ class Size
+ {
+ public:
+ int width() const { return 0; }
+ int height() const { return 0; }
+ };
+class Size
+{
+ public:
+ int width() const { return 0; }
+ int height() const { return 0; }
+ std::string ToString() const { return "0x0"; }
+};
+} // namespace gfx
+
+struct DxDiagNode
+{
+};
+{};
+
+// TODO(jmadill): other platforms
+// clang-format off
......@@ -101,9 +102,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/angle_config.h gpu
+// clang-format on
+
+#endif
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_info.cc gpu_test_expectations/gpu_info.cc
--- gpu_test_expectations_reverted/gpu_info.cc 2018-01-29 15:22:50.931147900 -0500
+++ gpu_test_expectations/gpu_info.cc 2017-10-23 13:31:30.199473500 -0400
diff -rupN gpu_test_expectations_reverted/gpu_info.cc gpu_test_expectations/gpu_info.cc
--- gpu_test_expectations_reverted/gpu_info.cc 2019-03-01 12:42:46.241215684 -0500
+++ gpu_test_expectations/gpu_info.cc 2019-03-01 14:22:15.015379305 -0500
@@ -4,7 +4,7 @@
#include <stdint.h>
......@@ -113,18 +114,18 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_info.cc gpu_te
namespace {
@@ -100,7 +100,7 @@ const GPUInfo::GPUDevice& GPUInfo::activ
@@ -214,7 +214,7 @@ const GPUInfo::GPUDevice& GPUInfo::activ
if (secondary_gpu.active)
return secondary_gpu;
}
- DLOG(ERROR) << "No active GPU found, returning primary GPU.";
+ DLOG(ERROR) << "No active GPU found, returning primary GPU.\n";
- DVLOG(2) << "No active GPU found, returning primary GPU.";
+ DVLOG(2) << "No active GPU found, returning primary GPU.\n";
return gpu;
}
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_info.h gpu_test_expectations/gpu_info.h
--- gpu_test_expectations_reverted/gpu_info.h 2018-01-29 15:22:50.934249500 -0500
+++ gpu_test_expectations/gpu_info.h 2017-10-23 13:31:30.199473500 -0400
diff -rupN gpu_test_expectations_reverted/gpu_info.h gpu_test_expectations/gpu_info.h
--- gpu_test_expectations_reverted/gpu_info.h 2019-03-01 12:43:15.585224456 -0500
+++ gpu_test_expectations/gpu_info.h 2019-03-01 14:22:15.015379305 -0500
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
......@@ -150,16 +151,16 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_info.h gpu_tes
#if defined(USE_X11)
typedef unsigned long VisualID;
@@ -299,4 +294,4 @@ struct GPU_EXPORT GPUInfo {
@@ -403,4 +398,4 @@ struct GPU_EXPORT GPUInfo {
} // namespace gpu
-#endif // GPU_CONFIG_GPU_INFO_H_
+#endif // ANGLE_GPU_CONFIG_GPU_INFO_H_
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc gpu_test_expectations/gpu_test_config.cc
--- gpu_test_expectations_reverted/gpu_test_config.cc 2018-01-29 15:22:50.938244500 -0500
+++ gpu_test_expectations/gpu_test_config.cc 2018-01-29 15:41:35.330454900 -0500
@@ -2,21 +2,53 @@
diff -rupN gpu_test_expectations_reverted/gpu_test_config.cc gpu_test_expectations/gpu_test_config.cc
--- gpu_test_expectations_reverted/gpu_test_config.cc 2019-03-01 12:51:43.713376340 -0500
+++ gpu_test_expectations/gpu_test_config.cc 2019-03-01 14:22:15.015379305 -0500
@@ -2,22 +2,53 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
......@@ -170,7 +171,8 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc
#include <stdint.h>
-#include "base/logging.h"
-#include "base/sys_info.h"
-#include "base/system/sys_info.h"
-#include "build/build_config.h"
-#include "gpu/config/gpu_info.h"
-#include "gpu/config/gpu_info_collector.h"
-#include "gpu/config/gpu_test_expectations_parser.h"
......@@ -221,7 +223,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc
namespace gpu {
namespace {
@@ -46,8 +78,7 @@ GPUTestConfig::OS GetCurrentOS() {
@@ -47,8 +78,7 @@ GPUTestConfig::OS GetCurrentOS() {
int32_t major_version = 0;
int32_t minor_version = 0;
int32_t bugfix_version = 0;
......@@ -231,34 +233,34 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc
if (major_version == 10) {
switch (minor_version) {
case 5:
@@ -76,6 +107,26 @@ GPUTestConfig::OS GetCurrentOS() {
@@ -81,6 +111,26 @@ GPUTestConfig::OS GetCurrentOS() {
return GPUTestConfig::kOsUnknown;
}
+#if !defined(OS_ANDROID)
+CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
+bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
+ angle::SystemInfo info;
+ if (!angle::GetSystemInfo(&info)) {
+ return kCollectInfoFatalFailure;
+ return false;
+ }
+ const angle::GPUDeviceInfo& gpu = info.gpus[info.primaryGPUIndex];
+ gpu_info->gpu.vendor_id = gpu.vendorId;
+ gpu_info->gpu.device_id = gpu.deviceId;
+ gpu_info->gpu.active = true;
+ return kCollectInfoSuccess;
+ return true;
+}
+#else
+CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
+bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
+ gpu_info->gpu.vendor_id = 0;
+ gpu_info->gpu.device_id = 0;
+ gpu_info->gpu.active = true;
+ return kCollectInfoNonFatalFailure;
+ return false;
+}
+#endif // defined(OS_ANDROID)
} // namespace anonymous
GPUTestConfig::GPUTestConfig()
@@ -112,7 +163,7 @@ void GPUTestConfig::set_build_type(int32
@@ -116,7 +166,7 @@ void GPUTestConfig::set_build_type(int32
}
void GPUTestConfig::set_api(int32_t api) {
......@@ -267,16 +269,16 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc
api_ = api;
}
@@ -260,7 +311,7 @@ bool GPUTestBotConfig::LoadCurrentConfig
@@ -261,7 +311,7 @@ bool GPUTestBotConfig::LoadCurrentConfig
#else
GPUInfo my_gpu_info;
CollectInfoResult result = CollectBasicGraphicsInfo(&my_gpu_info);
if (result != kCollectInfoSuccess) {
if (!CollectBasicGraphicsInfo(&my_gpu_info)) {
- LOG(ERROR) << "Fail to identify GPU";
+ LOG(ERROR) << "Fail to identify GPU\n";
DisableGPUInfoValidation();
rt = true;
rt = false;
} else {
@@ -271,7 +322,7 @@ bool GPUTestBotConfig::LoadCurrentConfig
rt = SetGPUInfo(my_gpu_info);
@@ -272,7 +322,7 @@ bool GPUTestBotConfig::LoadCurrentConfig
}
set_os(GetCurrentOS());
if (os() == kOsUnknown) {
......@@ -285,9 +287,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc
rt = false;
}
#if defined(NDEBUG)
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.h gpu_test_expectations/gpu_test_config.h
--- gpu_test_expectations_reverted/gpu_test_config.h 2018-01-29 15:22:50.941246600 -0500
+++ gpu_test_expectations/gpu_test_config.h 2018-01-29 15:41:01.117639000 -0500
diff -rupN gpu_test_expectations_reverted/gpu_test_config.h gpu_test_expectations/gpu_test_config.h
--- gpu_test_expectations_reverted/gpu_test_config.h 2019-03-01 12:49:49.793342296 -0500
+++ gpu_test_expectations/gpu_test_config.h 2019-03-01 14:22:15.015379305 -0500
@@ -2,16 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
......@@ -308,7 +310,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.h
namespace gpu {
@@ -56,6 +55,7 @@ class GPU_EXPORT GPUTestConfig {
@@ -58,6 +57,7 @@ class GPU_EXPORT GPUTestConfig {
kAPID3D11 = 1 << 1,
kAPIGLDesktop = 1 << 2,
kAPIGLES = 1 << 3,
......@@ -316,16 +318,16 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.h
};
GPUTestConfig();
@@ -145,5 +145,5 @@ class GPU_EXPORT GPUTestBotConfig : publ
@@ -140,5 +140,5 @@ class GPU_EXPORT GPUTestBotConfig : publ
} // namespace gpu
-#endif // GPU_CONFIG_GPU_TEST_CONFIG_H_
+#endif // ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config_mac.h gpu_test_expectations/gpu_test_config_mac.h
diff -rupN gpu_test_expectations_reverted/gpu_test_config_mac.h gpu_test_expectations/gpu_test_config_mac.h
--- gpu_test_expectations_reverted/gpu_test_config_mac.h 1969-12-31 19:00:00.000000000 -0500
+++ gpu_test_expectations/gpu_test_config_mac.h 2017-10-31 10:53:42.173222700 -0400
+++ gpu_test_expectations/gpu_test_config_mac.h 2019-03-01 11:11:32.031451625 -0500
@@ -0,0 +1,24 @@
+//
+// Copyright 2015 The ANGLE Project Authors. All rights reserved.
......@@ -348,12 +350,12 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config_ma
+ int32_t *minor_version,
+ int32_t *bugfix_version);
+
+} // namespace angle
+} // namespace angle
+
+#endif // ANGLE_GPU_TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config_mac.mm gpu_test_expectations/gpu_test_config_mac.mm
+#endif // ANGLE_GPU_TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
diff -rupN gpu_test_expectations_reverted/gpu_test_config_mac.mm gpu_test_expectations/gpu_test_config_mac.mm
--- gpu_test_expectations_reverted/gpu_test_config_mac.mm 1969-12-31 19:00:00.000000000 -0500
+++ gpu_test_expectations/gpu_test_config_mac.mm 2017-10-31 10:53:42.174247100 -0400
+++ gpu_test_expectations/gpu_test_config_mac.mm 2019-03-01 12:40:41.361175994 -0500
@@ -0,0 +1,49 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
......@@ -404,9 +406,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config_ma
+}
+
+} // namespace angle
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectations_parser.cc gpu_test_expectations/gpu_test_expectations_parser.cc
--- gpu_test_expectations_reverted/gpu_test_expectations_parser.cc 2018-01-29 15:22:50.947689800 -0500
+++ gpu_test_expectations/gpu_test_expectations_parser.cc 2018-01-29 15:42:52.940626000 -0500
diff -rupN gpu_test_expectations_reverted/gpu_test_expectations_parser.cc gpu_test_expectations/gpu_test_expectations_parser.cc
--- gpu_test_expectations_reverted/gpu_test_expectations_parser.cc 2019-03-01 13:06:29.453651892 -0500
+++ gpu_test_expectations/gpu_test_expectations_parser.cc 2019-03-01 14:22:15.015379305 -0500
@@ -2,17 +2,47 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
......@@ -462,7 +464,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
namespace gpu {
@@ -62,6 +92,7 @@ enum Token {
@@ -63,6 +93,7 @@ enum Token {
kConfigD3D11,
kConfigGLDesktop,
kConfigGLES,
......@@ -470,7 +472,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
// expectation
kExpectationPass,
kExpectationFail,
@@ -115,6 +146,7 @@ const TokenInfo kTokenData[] = {
@@ -117,6 +148,7 @@ const TokenInfo kTokenData[] = {
{"d3d11", GPUTestConfig::kAPID3D11},
{"opengl", GPUTestConfig::kAPIGLDesktop},
{"gles", GPUTestConfig::kAPIGLES},
......@@ -478,7 +480,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
{"pass", GPUTestExpectationsParser::kGpuTestPass},
{"fail", GPUTestExpectationsParser::kGpuTestFail},
{"flaky", GPUTestExpectationsParser::kGpuTestFlaky},
@@ -153,9 +185,9 @@ const char* kErrorMessage[] = {
@@ -155,9 +187,9 @@ const char* kErrorMessage[] = {
};
Token ParseToken(const std::string& word) {
......@@ -490,7 +492,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
return kConfigGPUDeviceID;
for (int32_t i = 0; i < kNumberOfExactMatchTokens; ++i) {
@@ -211,8 +243,8 @@ bool GPUTestExpectationsParser::LoadTest
@@ -212,8 +244,8 @@ bool GPUTestExpectationsParser::LoadTest
return rt;
}
......@@ -501,7 +503,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
entries_.clear();
error_messages_.clear();
@@ -279,6 +311,7 @@ bool GPUTestExpectationsParser::ParseCon
@@ -281,6 +313,7 @@ bool GPUTestExpectationsParser::ParseCon
case kConfigD3D11:
case kConfigGLDesktop:
case kConfigGLES:
......@@ -509,7 +511,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
case kConfigGPUDeviceID:
if (token == kConfigGPUDeviceID) {
if (!UpdateTestConfig(config, tokens[i], 0))
@@ -340,6 +373,7 @@ bool GPUTestExpectationsParser::ParseLin
@@ -343,6 +376,7 @@ bool GPUTestExpectationsParser::ParseLin
case kConfigD3D11:
case kConfigGLDesktop:
case kConfigGLES:
......@@ -517,7 +519,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
case kConfigGPUDeviceID:
// MODIFIERS, could be in any order, need at least one.
if (stage != kLineParserConfigs && stage != kLineParserBugID) {
@@ -493,6 +527,7 @@ bool GPUTestExpectationsParser::UpdateTe
@@ -497,6 +531,7 @@ bool GPUTestExpectationsParser::UpdateTe
case kConfigD3D11:
case kConfigGLDesktop:
case kConfigGLES:
......@@ -525,7 +527,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
if ((config->api() & kTokenData[token].flag) != 0) {
PushErrorMessage(kErrorMessage[kErrorEntryWithAPIConflicts],
line_number);
@@ -542,20 +577,17 @@ bool GPUTestExpectationsParser::DetectCo
@@ -546,20 +581,17 @@ bool GPUTestExpectationsParser::DetectCo
void GPUTestExpectationsParser::PushErrorMessage(
const std::string& message, size_t line_number) {
......@@ -551,9 +553,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
}
GPUTestExpectationsParser:: GPUTestExpectationEntry::GPUTestExpectationEntry()
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectations_parser.h gpu_test_expectations/gpu_test_expectations_parser.h
--- gpu_test_expectations_reverted/gpu_test_expectations_parser.h 2018-01-29 15:22:50.951678900 -0500
+++ gpu_test_expectations/gpu_test_expectations_parser.h 2017-09-11 17:09:26.897372200 -0400
diff -rupN gpu_test_expectations_reverted/gpu_test_expectations_parser.h gpu_test_expectations/gpu_test_expectations_parser.h
--- gpu_test_expectations_reverted/gpu_test_expectations_parser.h 2019-03-01 11:22:00.751623455 -0500
+++ gpu_test_expectations/gpu_test_expectations_parser.h 2019-03-01 13:04:50.721621228 -0500
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
......
......@@ -21,6 +21,7 @@
#define DCHECK_NE(A, B) ASSERT((A) != (B))
#define DCHECK(X) ASSERT(X)
#define DLOG(X) std::cerr
#define DVLOG(X) std::cerr
#define LOG(X) std::cerr
#define GPU_EXPORT
......@@ -48,6 +49,7 @@ class Size
public:
int width() const { return 0; }
int height() const { return 0; }
std::string ToString() const { return "0x0"; }
};
} // namespace gfx
......@@ -64,6 +66,8 @@ struct DxDiagNode
# define OS_LINUX
#elif defined(__APPLE__)
# define OS_MACOSX
#elif defined(__Fuchsia__)
# define OS_FUCHSIA
#else
# error "Unsupported platform"
#endif
......
......@@ -16,6 +16,11 @@ void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice& device,
enumerator->AddBool("active", device.active);
enumerator->AddString("vendorString", device.vendor_string);
enumerator->AddString("deviceString", device.device_string);
enumerator->AddString("driverVendor", device.driver_vendor);
enumerator->AddString("driverVersion", device.driver_version);
enumerator->AddString("driverDate", device.driver_date);
enumerator->AddInt("cudaComputeCapabilityMajor",
device.cuda_compute_capability_major);
enumerator->EndGPUDevice();
}
......@@ -45,25 +50,136 @@ void EnumerateVideoEncodeAcceleratorSupportedProfile(
enumerator->EndVideoEncodeAcceleratorSupportedProfile();
}
const char* ImageDecodeAcceleratorTypeToString(
gpu::ImageDecodeAcceleratorType type) {
switch (type) {
case gpu::ImageDecodeAcceleratorType::kJpeg:
return "JPEG";
case gpu::ImageDecodeAcceleratorType::kUnknown:
return "Unknown";
}
}
const char* ImageDecodeAcceleratorSubsamplingToString(
gpu::ImageDecodeAcceleratorSubsampling subsampling) {
switch (subsampling) {
case gpu::ImageDecodeAcceleratorSubsampling::k420:
return "4:2:0";
case gpu::ImageDecodeAcceleratorSubsampling::k422:
return "4:2:2";
}
}
void EnumerateImageDecodeAcceleratorSupportedProfile(
const gpu::ImageDecodeAcceleratorSupportedProfile& profile,
gpu::GPUInfo::Enumerator* enumerator) {
enumerator->BeginImageDecodeAcceleratorSupportedProfile();
enumerator->AddString("imageType",
ImageDecodeAcceleratorTypeToString(profile.image_type));
enumerator->AddString("minEncodedDimensions",
profile.min_encoded_dimensions.ToString());
enumerator->AddString("maxEncodedDimensions",
profile.max_encoded_dimensions.ToString());
std::string subsamplings;
for (size_t i = 0; i < profile.subsamplings.size(); i++) {
if (i > 0)
subsamplings += ", ";
subsamplings +=
ImageDecodeAcceleratorSubsamplingToString(profile.subsamplings[i]);
}
enumerator->AddString("subsamplings", subsamplings);
enumerator->EndImageDecodeAcceleratorSupportedProfile();
}
#if defined(OS_WIN)
void EnumerateOverlayCapability(const gpu::OverlayCapability& cap,
gpu::GPUInfo::Enumerator* enumerator) {
std::string key_string = "overlayCap";
key_string += OverlayFormatToString(cap.format);
enumerator->BeginOverlayCapability();
enumerator->AddString(key_string.c_str(),
cap.is_scaling_supported ? "SCALING" : "DIRECT");
enumerator->EndOverlayCapability();
}
void EnumerateDx12VulkanVersionInfo(const gpu::Dx12VulkanVersionInfo& info,
gpu::GPUInfo::Enumerator* enumerator) {
enumerator->BeginDx12VulkanVersionInfo();
enumerator->AddBool("supportsDx12", info.supports_dx12);
enumerator->AddBool("supportsVulkan", info.supports_vulkan);
enumerator->AddInt("dx12FeatureLevel",
static_cast<int>(info.d3d12_feature_level));
enumerator->AddInt("vulkanVersion", static_cast<int>(info.vulkan_version));
enumerator->EndDx12VulkanVersionInfo();
}
#endif
} // namespace
namespace gpu {
#if defined(OS_WIN)
const char* OverlayFormatToString(OverlayFormat format) {
switch (format) {
case OverlayFormat::kBGRA:
return "BGRA";
case OverlayFormat::kYUY2:
return "YUY2";
case OverlayFormat::kNV12:
return "NV12";
}
}
bool OverlayCapability::operator==(const OverlayCapability& other) const {
return format == other.format &&
is_scaling_supported == other.is_scaling_supported;
}
#endif
VideoDecodeAcceleratorCapabilities::VideoDecodeAcceleratorCapabilities()
: flags(0) {}
VideoDecodeAcceleratorCapabilities::VideoDecodeAcceleratorCapabilities(
const VideoDecodeAcceleratorCapabilities& other) = default;
VideoDecodeAcceleratorCapabilities::~VideoDecodeAcceleratorCapabilities() {}
VideoDecodeAcceleratorCapabilities::~VideoDecodeAcceleratorCapabilities() =
default;
ImageDecodeAcceleratorSupportedProfile::ImageDecodeAcceleratorSupportedProfile()
: image_type(ImageDecodeAcceleratorType::kUnknown) {}
ImageDecodeAcceleratorSupportedProfile::ImageDecodeAcceleratorSupportedProfile(
const ImageDecodeAcceleratorSupportedProfile& other) = default;
ImageDecodeAcceleratorSupportedProfile::ImageDecodeAcceleratorSupportedProfile(
ImageDecodeAcceleratorSupportedProfile&& other) = default;
ImageDecodeAcceleratorSupportedProfile::
~ImageDecodeAcceleratorSupportedProfile() = default;
ImageDecodeAcceleratorSupportedProfile& ImageDecodeAcceleratorSupportedProfile::
operator=(const ImageDecodeAcceleratorSupportedProfile& other) = default;
ImageDecodeAcceleratorSupportedProfile& ImageDecodeAcceleratorSupportedProfile::
operator=(ImageDecodeAcceleratorSupportedProfile&& other) = default;
GPUInfo::GPUDevice::GPUDevice()
: vendor_id(0),
device_id(0),
active(false) {
}
active(false),
cuda_compute_capability_major(0) {}
GPUInfo::GPUDevice::GPUDevice(const GPUInfo::GPUDevice& other) = default;
GPUInfo::GPUDevice::GPUDevice(GPUInfo::GPUDevice&& other) noexcept = default;
GPUInfo::GPUDevice::~GPUDevice() { }
GPUInfo::GPUDevice::~GPUDevice() noexcept = default;
GPUInfo::GPUDevice& GPUInfo::GPUDevice::operator=(
const GPUInfo::GPUDevice& other) = default;
GPUInfo::GPUDevice& GPUInfo::GPUDevice::operator=(
GPUInfo::GPUDevice&& other) noexcept = default;
GPUInfo::GPUInfo()
: optimus(false),
......@@ -72,38 +188,40 @@ GPUInfo::GPUInfo()
software_rendering(false),
direct_rendering(true),
sandboxed(false),
process_crash_count(0),
in_process_gpu(true),
passthrough_cmd_decoder(false),
basic_info_state(kCollectInfoNone),
context_info_state(kCollectInfoNone),
#if defined(OS_WIN)
dx_diagnostics_info_state(kCollectInfoNone),
#endif
jpeg_decode_accelerator_supported(false)
jpeg_decode_accelerator_supported(false),
#if defined(USE_X11)
,
system_visual(0),
rgba_visual(0)
rgba_visual(0),
#endif
{
oop_rasterization_supported(false) {
}
GPUInfo::GPUInfo(const GPUInfo& other) = default;
GPUInfo::~GPUInfo() { }
GPUInfo::~GPUInfo() = default;
GPUInfo::GPUDevice& GPUInfo::active_gpu() {
return const_cast<GPUInfo::GPUDevice&>(
const_cast<const GPUInfo&>(*this).active_gpu());
}
const GPUInfo::GPUDevice& GPUInfo::active_gpu() const {
if (gpu.active)
if (gpu.active || secondary_gpus.empty())
return gpu;
for (const GPUDevice& secondary_gpu : secondary_gpus) {
for (const auto& secondary_gpu : secondary_gpus) {
if (secondary_gpu.active)
return secondary_gpu;
}
DLOG(ERROR) << "No active GPU found, returning primary GPU.\n";
DVLOG(2) << "No active GPU found, returning primary GPU.\n";
return gpu;
}
bool GPUInfo::IsInitialized() const {
return gpu.vendor_id != 0 || !gl_vendor.empty();
}
void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
struct GPUInfoKnownFields {
base::TimeDelta initialization_time;
......@@ -111,9 +229,6 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
bool amd_switchable;
GPUDevice gpu;
std::vector<GPUDevice> secondary_gpus;
std::string driver_vendor;
std::string driver_version;
std::string driver_date;
std::string pixel_shader_version;
std::string vertex_shader_version;
std::string max_msaa_samples;
......@@ -130,25 +245,31 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
bool software_rendering;
bool direct_rendering;
bool sandboxed;
int process_crash_count;
bool in_process_gpu;
bool passthrough_cmd_decoder;
bool supports_overlays;
bool can_support_threaded_texture_mailbox;
CollectInfoResult basic_info_state;
CollectInfoResult context_info_state;
#if defined(OS_WIN)
CollectInfoResult dx_diagnostics_info_state;
bool direct_composition;
bool supports_overlays;
OverlayCapabilities overlay_capabilities;
DxDiagNode dx_diagnostics;
Dx12VulkanVersionInfo dx12_vulkan_version_info;
#endif
VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities;
VideoEncodeAcceleratorSupportedProfiles
video_encode_accelerator_supported_profiles;
bool jpeg_decode_accelerator_supported;
ImageDecodeAcceleratorSupportedProfiles
image_decode_accelerator_supported_profiles;
#if defined(USE_X11)
VisualID system_visual;
VisualID rgba_visual;
#endif
bool oop_rasterization_supported;
};
// If this assert fails then most likely something below needs to be updated.
......@@ -162,7 +283,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
enumerator->AddString("machineModelName", machine_model_name);
enumerator->AddString("machineModelVersion", machine_model_version);
EnumerateGPUDevice(gpu, enumerator);
for (const auto& secondary_gpu: secondary_gpus)
for (const auto& secondary_gpu : secondary_gpus)
EnumerateGPUDevice(secondary_gpu, enumerator);
enumerator->BeginAuxAttributes();
......@@ -170,9 +291,6 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
initialization_time);
enumerator->AddBool("optimus", optimus);
enumerator->AddBool("amdSwitchable", amd_switchable);
enumerator->AddString("driverVendor", driver_vendor);
enumerator->AddString("driverVersion", driver_version);
enumerator->AddString("driverDate", driver_date);
enumerator->AddString("pixelShaderVersion", pixel_shader_version);
enumerator->AddString("vertexShaderVersion", vertex_shader_version);
enumerator->AddString("maxMsaaSamples", max_msaa_samples);
......@@ -190,18 +308,18 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
enumerator->AddBool("softwareRendering", software_rendering);
enumerator->AddBool("directRendering", direct_rendering);
enumerator->AddBool("sandboxed", sandboxed);
enumerator->AddInt("processCrashCount", process_crash_count);
enumerator->AddBool("inProcessGpu", in_process_gpu);
enumerator->AddBool("passthroughCmdDecoder", passthrough_cmd_decoder);
enumerator->AddBool("supportsOverlays", supports_overlays);
enumerator->AddBool("canSupportThreadedTextureMailbox",
can_support_threaded_texture_mailbox);
enumerator->AddInt("basicInfoState", basic_info_state);
enumerator->AddInt("contextInfoState", context_info_state);
// TODO(kbr): add dx_diagnostics on Windows.
#if defined(OS_WIN)
enumerator->AddInt("DxDiagnosticsInfoState", dx_diagnostics_info_state);
enumerator->AddBool("directComposition", direct_composition);
enumerator->AddBool("supportsOverlays", supports_overlays);
for (const auto& cap : overlay_capabilities)
EnumerateOverlayCapability(cap, enumerator);
EnumerateDx12VulkanVersionInfo(dx12_vulkan_version_info, enumerator);
#endif
// TODO(kbr): add dx_diagnostics on Windows.
enumerator->AddInt("videoDecodeAcceleratorFlags",
video_decode_accelerator_capabilities.flags);
for (const auto& profile :
......@@ -211,10 +329,13 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
EnumerateVideoEncodeAcceleratorSupportedProfile(profile, enumerator);
enumerator->AddBool("jpegDecodeAcceleratorSupported",
jpeg_decode_accelerator_supported);
for (const auto& profile : image_decode_accelerator_supported_profiles)
EnumerateImageDecodeAcceleratorSupportedProfile(profile, enumerator);
#if defined(USE_X11)
enumerator->AddInt64("systemVisual", system_visual);
enumerator->AddInt64("rgbaVisual", rgba_visual);
#endif
enumerator->AddBool("oopRasterizationSupported", oop_rasterization_supported);
enumerator->EndAuxAttributes();
}
......
......@@ -19,281 +19,381 @@
typedef unsigned long VisualID;
#endif
namespace gpu
{
// Result for the various Collect*Info* functions below.
// Fatal failures are for cases where we can't create a context at all or
// something, making the use of the GPU impossible.
// Non-fatal failures are for cases where we could gather most info, but maybe
// some is missing (e.g. unable to parse a version string or to detect the exact
// model).
enum CollectInfoResult
{
kCollectInfoNone = 0,
kCollectInfoSuccess = 1,
kCollectInfoNonFatalFailure = 2,
kCollectInfoFatalFailure = 3
namespace gpu {
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class GpuSeriesType {
kUnknown = 0,
// Intel 6th gen
kIntelSandyBridge = 1,
// Intel 7th gen
kIntelValleyView = 2, // BayTrail
kIntelIvyBridge = 3,
kIntelHaswell = 4,
// Intel 8th gen
kIntelCherryView = 5, // Braswell
kIntelBroadwell = 6,
// Intel 9th gen
kIntelApolloLake = 7,
kIntelSkyLake = 8,
kIntelGeminiLake = 9,
kIntelKabyLake = 10,
kIntelCoffeeLake = 11,
// Please also update |gpu_series_map| in process_json.py.
kMaxValue = kIntelCoffeeLake,
};
// Video profile. This *must* match media::VideoCodecProfile.
enum VideoCodecProfile
{
VIDEO_CODEC_PROFILE_UNKNOWN = -1,
VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN,
H264PROFILE_BASELINE = 0,
H264PROFILE_MAIN,
H264PROFILE_EXTENDED,
H264PROFILE_HIGH,
H264PROFILE_HIGH10PROFILE,
H264PROFILE_HIGH422PROFILE,
H264PROFILE_HIGH444PREDICTIVEPROFILE,
H264PROFILE_SCALABLEBASELINE,
H264PROFILE_SCALABLEHIGH,
H264PROFILE_STEREOHIGH,
H264PROFILE_MULTIVIEWHIGH,
VP8PROFILE_ANY,
VP9PROFILE_PROFILE0,
VP9PROFILE_PROFILE1,
VP9PROFILE_PROFILE2,
VP9PROFILE_PROFILE3,
HEVCPROFILE_MAIN,
HEVCPROFILE_MAIN10,
HEVCPROFILE_MAIN_STILL_PICTURE,
DOLBYVISION_PROFILE0,
DOLBYVISION_PROFILE4,
DOLBYVISION_PROFILE5,
DOLBYVISION_PROFILE7,
THEORAPROFILE_ANY,
VIDEO_CODEC_PROFILE_MAX = THEORAPROFILE_ANY,
enum VideoCodecProfile {
VIDEO_CODEC_PROFILE_UNKNOWN = -1,
VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN,
H264PROFILE_BASELINE = 0,
H264PROFILE_MAIN,
H264PROFILE_EXTENDED,
H264PROFILE_HIGH,
H264PROFILE_HIGH10PROFILE,
H264PROFILE_HIGH422PROFILE,
H264PROFILE_HIGH444PREDICTIVEPROFILE,
H264PROFILE_SCALABLEBASELINE,
H264PROFILE_SCALABLEHIGH,
H264PROFILE_STEREOHIGH,
H264PROFILE_MULTIVIEWHIGH,
VP8PROFILE_ANY,
VP9PROFILE_PROFILE0,
VP9PROFILE_PROFILE1,
VP9PROFILE_PROFILE2,
VP9PROFILE_PROFILE3,
HEVCPROFILE_MAIN,
HEVCPROFILE_MAIN10,
HEVCPROFILE_MAIN_STILL_PICTURE,
DOLBYVISION_PROFILE0,
DOLBYVISION_PROFILE4,
DOLBYVISION_PROFILE5,
DOLBYVISION_PROFILE7,
THEORAPROFILE_ANY,
AV1PROFILE_PROFILE_MAIN,
AV1PROFILE_PROFILE_HIGH,
AV1PROFILE_PROFILE_PRO,
VIDEO_CODEC_PROFILE_MAX = AV1PROFILE_PROFILE_PRO,
};
// Specification of a decoding profile supported by a hardware decoder.
struct GPU_EXPORT VideoDecodeAcceleratorSupportedProfile
{
VideoCodecProfile profile;
gfx::Size max_resolution;
gfx::Size min_resolution;
bool encrypted_only;
struct GPU_EXPORT VideoDecodeAcceleratorSupportedProfile {
VideoCodecProfile profile;
gfx::Size max_resolution;
gfx::Size min_resolution;
bool encrypted_only;
};
using VideoDecodeAcceleratorSupportedProfiles = std::vector<VideoDecodeAcceleratorSupportedProfile>;
using VideoDecodeAcceleratorSupportedProfiles =
std::vector<VideoDecodeAcceleratorSupportedProfile>;
struct GPU_EXPORT VideoDecodeAcceleratorCapabilities
{
VideoDecodeAcceleratorCapabilities();
VideoDecodeAcceleratorCapabilities(const VideoDecodeAcceleratorCapabilities &other);
~VideoDecodeAcceleratorCapabilities();
VideoDecodeAcceleratorSupportedProfiles supported_profiles;
uint32_t flags;
struct GPU_EXPORT VideoDecodeAcceleratorCapabilities {
VideoDecodeAcceleratorCapabilities();
VideoDecodeAcceleratorCapabilities(
const VideoDecodeAcceleratorCapabilities& other);
~VideoDecodeAcceleratorCapabilities();
VideoDecodeAcceleratorSupportedProfiles supported_profiles;
uint32_t flags;
};
// Specification of an encoding profile supported by a hardware encoder.
struct GPU_EXPORT VideoEncodeAcceleratorSupportedProfile
{
VideoCodecProfile profile;
gfx::Size max_resolution;
uint32_t max_framerate_numerator;
uint32_t max_framerate_denominator;
struct GPU_EXPORT VideoEncodeAcceleratorSupportedProfile {
VideoCodecProfile profile;
gfx::Size max_resolution;
uint32_t max_framerate_numerator;
uint32_t max_framerate_denominator;
};
using VideoEncodeAcceleratorSupportedProfiles = std::vector<VideoEncodeAcceleratorSupportedProfile>;
using VideoEncodeAcceleratorSupportedProfiles =
std::vector<VideoEncodeAcceleratorSupportedProfile>;
struct GPU_EXPORT GPUInfo
{
struct GPU_EXPORT GPUDevice
{
GPUDevice();
~GPUDevice();
enum class ImageDecodeAcceleratorType {
kJpeg = 0,
kUnknown = 1,
kMaxValue = kUnknown,
};
// The DWORD (uint32_t) representing the graphics card vendor id.
uint32_t vendor_id;
enum class ImageDecodeAcceleratorSubsampling {
k420 = 0,
k422 = 1,
kMaxValue = k422,
};
// The DWORD (uint32_t) representing the graphics card device id.
// Device ids are unique to vendor, not to one another.
uint32_t device_id;
// Specification of an image decoding profile supported by a hardware decoder.
struct GPU_EXPORT ImageDecodeAcceleratorSupportedProfile {
ImageDecodeAcceleratorSupportedProfile();
ImageDecodeAcceleratorSupportedProfile(
const ImageDecodeAcceleratorSupportedProfile& other);
ImageDecodeAcceleratorSupportedProfile(
ImageDecodeAcceleratorSupportedProfile&& other);
~ImageDecodeAcceleratorSupportedProfile();
ImageDecodeAcceleratorSupportedProfile& operator=(
const ImageDecodeAcceleratorSupportedProfile& other);
ImageDecodeAcceleratorSupportedProfile& operator=(
ImageDecodeAcceleratorSupportedProfile&& other);
// Fields common to all image types.
// Type of image to which this profile applies, e.g., JPEG.
ImageDecodeAcceleratorType image_type;
// Minimum and maximum supported pixel dimensions of the encoded image.
gfx::Size min_encoded_dimensions;
gfx::Size max_encoded_dimensions;
// Fields specific to |image_type| == kJpeg.
// The supported chroma subsampling formats, e.g. 4:2:0.
std::vector<ImageDecodeAcceleratorSubsampling> subsamplings;
};
using ImageDecodeAcceleratorSupportedProfiles =
std::vector<ImageDecodeAcceleratorSupportedProfile>;
// Whether this GPU is the currently used one.
// Currently this field is only supported and meaningful on OS X.
bool active;
#if defined(OS_WIN)
// Common overlay formats that we're interested in. Must match the OverlayFormat
// enum in //tools/metrics/histograms/enums.xml. Mapped to corresponding DXGI
// formats in DirectCompositionSurfaceWin.
enum class OverlayFormat { kBGRA = 0, kYUY2 = 1, kNV12 = 2, kMaxValue = kNV12 };
// The strings that describe the GPU.
// In Linux these strings are obtained through libpci.
// In Win/MacOSX, these two strings are not filled at the moment.
// In Android, these are respectively GL_VENDOR and GL_RENDERER.
std::string vendor_string;
std::string device_string;
};
GPU_EXPORT const char* OverlayFormatToString(OverlayFormat format);
GPUInfo();
GPUInfo(const GPUInfo &other);
~GPUInfo();
struct GPU_EXPORT OverlayCapability {
OverlayFormat format;
bool is_scaling_supported;
bool operator==(const OverlayCapability& other) const;
};
using OverlayCapabilities = std::vector<OverlayCapability>;
// The amount of time taken to get from the process starting to the message
// loop being pumped.
base::TimeDelta initialization_time;
struct GPU_EXPORT Dx12VulkanVersionInfo {
bool IsEmpty() const { return !d3d12_feature_level && !vulkan_version; }
// Computer has NVIDIA Optimus
bool optimus;
// True if the GPU driver supports DX12.
bool supports_dx12 = false;
// Computer has AMD Dynamic Switchable Graphics
bool amd_switchable;
// True if the GPU driver supports Vulkan.
bool supports_vulkan = false;
// Primary GPU, for exmaple, the discrete GPU in a dual GPU machine.
GPUDevice gpu;
// The supported d3d feature level in the gpu driver;
uint32_t d3d12_feature_level = 0;
// Secondary GPUs, for example, the integrated GPU in a dual GPU machine.
std::vector<GPUDevice> secondary_gpus;
// The support Vulkan API version in the gpu driver;
uint32_t vulkan_version = 0;
};
#endif
// The currently active gpu.
const GPUDevice &active_gpu() const;
struct GPU_EXPORT GPUInfo {
struct GPU_EXPORT GPUDevice {
GPUDevice();
GPUDevice(const GPUDevice& other);
GPUDevice(GPUDevice&& other) noexcept;
~GPUDevice() noexcept;
GPUDevice& operator=(const GPUDevice& other);
GPUDevice& operator=(GPUDevice&& other) noexcept;
// The DWORD (uint32_t) representing the graphics card vendor id.
uint32_t vendor_id;
// The DWORD (uint32_t) representing the graphics card device id.
// Device ids are unique to vendor, not to one another.
uint32_t device_id;
// Whether this GPU is the currently used one.
// Currently this field is only supported and meaningful on OS X.
bool active;
// The strings that describe the GPU.
// In Linux these strings are obtained through libpci.
// In Win/MacOSX, these two strings are not filled at the moment.
// In Android, these are respectively GL_VENDOR and GL_RENDERER.
std::string vendor_string;
std::string device_string;
// The vendor of the graphics driver currently installed.
std::string driver_vendor;
// The version of the graphics driver currently installed.
std::string driver_version;
// The date of the graphics driver currently installed.
std::string driver_date;
// The version of the pixel/fragment shader used by the gpu.
std::string pixel_shader_version;
// NVIDIA CUDA compute capability, major version. 0 if undetermined. Can be
// used to determine the hardware generation that the GPU belongs to.
int cuda_compute_capability_major;
};
GPUInfo();
GPUInfo(const GPUInfo& other);
~GPUInfo();
// The version of the vertex shader used by the gpu.
std::string vertex_shader_version;
// The currently active gpu.
GPUDevice& active_gpu();
const GPUDevice& active_gpu() const;
// The maximum multisapling sample count, either through ES3 or
// EXT_multisampled_render_to_texture MSAA.
std::string max_msaa_samples;
bool IsInitialized() const;
// The machine model identifier. They can contain any character, including
// whitespaces. Currently it is supported on MacOSX and Android.
// Android examples: "Naxus 5", "XT1032".
// On MacOSX, the version is stripped out of the model identifier, for
// example, the original identifier is "MacBookPro7,2", and we put
// "MacBookPro" as machine_model_name, and "7.2" as machine_model_version.
std::string machine_model_name;
// The amount of time taken to get from the process starting to the message
// loop being pumped.
base::TimeDelta initialization_time;
// The version of the machine model. Currently it is supported on MacOSX.
// See machine_model_name's comment.
std::string machine_model_version;
// Computer has NVIDIA Optimus
bool optimus;
// The GL_VERSION string.
std::string gl_version;
// Computer has AMD Dynamic Switchable Graphics
bool amd_switchable;
// The GL_VENDOR string.
std::string gl_vendor;
// Primary GPU, for exmaple, the discrete GPU in a dual GPU machine.
GPUDevice gpu;
// The GL_RENDERER string.
std::string gl_renderer;
// Secondary GPUs, for example, the integrated GPU in a dual GPU machine.
std::vector<GPUDevice> secondary_gpus;
// The GL_EXTENSIONS string.
std::string gl_extensions;
// The version of the pixel/fragment shader used by the gpu.
std::string pixel_shader_version;
// GL window system binding vendor. "" if not available.
std::string gl_ws_vendor;
// The version of the vertex shader used by the gpu.
std::string vertex_shader_version;
// GL window system binding version. "" if not available.
std::string gl_ws_version;
// The maximum multisapling sample count, either through ES3 or
// EXT_multisampled_render_to_texture MSAA.
std::string max_msaa_samples;
// GL window system binding extensions. "" if not available.
std::string gl_ws_extensions;
// The machine model identifier. They can contain any character, including
// whitespaces. Currently it is supported on MacOSX and Android.
// Android examples: "Naxus 5", "XT1032".
// On MacOSX, the version is stripped out of the model identifier, for
// example, the original identifier is "MacBookPro7,2", and we put
// "MacBookPro" as machine_model_name, and "7.2" as machine_model_version.
std::string machine_model_name;
// GL reset notification strategy as defined by GL_ARB_robustness. 0 if GPU
// reset detection or notification not available.
uint32_t gl_reset_notification_strategy;
// The version of the machine model. Currently it is supported on MacOSX.
// See machine_model_name's comment.
std::string machine_model_version;
bool software_rendering;
// The GL_VERSION string.
std::string gl_version;
// Whether the driver uses direct rendering. True on most platforms, false on
// X11 when using remote X.
bool direct_rendering;
// The GL_VENDOR string.
std::string gl_vendor;
// Whether the gpu process is running in a sandbox.
bool sandboxed;
// The GL_RENDERER string.
std::string gl_renderer;
// Number of GPU process crashes recorded.
int process_crash_count;
// The GL_EXTENSIONS string.
std::string gl_extensions;
// True if the GPU is running in the browser process instead of its own.
bool in_process_gpu;
// GL window system binding vendor. "" if not available.
std::string gl_ws_vendor;
// True if the GPU process is using the passthrough command decoder.
bool passthrough_cmd_decoder;
// GL window system binding version. "" if not available.
std::string gl_ws_version;
// True if the current set of outputs supports overlays.
bool supports_overlays = false;
// GL window system binding extensions. "" if not available.
std::string gl_ws_extensions;
// True only on android when extensions for threaded mailbox sharing are
// present. Threaded mailbox sharing is used on Android only, so this check
// is only implemented on Android.
bool can_support_threaded_texture_mailbox = false;
// GL reset notification strategy as defined by GL_ARB_robustness. 0 if GPU
// reset detection or notification not available.
uint32_t gl_reset_notification_strategy;
bool software_rendering;
// Whether the driver uses direct rendering. True on most platforms, false on
// X11 when using remote X.
bool direct_rendering;
// Whether the gpu process is running in a sandbox.
bool sandboxed;
// True if the GPU is running in the browser process instead of its own.
bool in_process_gpu;
// True if the GPU process is using the passthrough command decoder.
bool passthrough_cmd_decoder;
// True only on android when extensions for threaded mailbox sharing are
// present. Threaded mailbox sharing is used on Android only, so this check
// is only implemented on Android.
bool can_support_threaded_texture_mailbox = false;
// The state of whether the basic/context/DxDiagnostics info is collected and
// if the collection fails or not.
CollectInfoResult basic_info_state;
CollectInfoResult context_info_state;
#if defined(OS_WIN)
CollectInfoResult dx_diagnostics_info_state;
// True if we use direct composition surface on Windows.
bool direct_composition = false;
// True if we use direct composition surface overlays on Windows.
bool supports_overlays = false;
OverlayCapabilities overlay_capabilities;
// The information returned by the DirectX Diagnostics Tool.
DxDiagNode dx_diagnostics;
// The information returned by the DirectX Diagnostics Tool.
DxDiagNode dx_diagnostics;
Dx12VulkanVersionInfo dx12_vulkan_version_info;
#endif
VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities;
VideoEncodeAcceleratorSupportedProfiles video_encode_accelerator_supported_profiles;
bool jpeg_decode_accelerator_supported;
VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities;
VideoEncodeAcceleratorSupportedProfiles
video_encode_accelerator_supported_profiles;
bool jpeg_decode_accelerator_supported;
ImageDecodeAcceleratorSupportedProfiles
image_decode_accelerator_supported_profiles;
#if defined(USE_X11)
VisualID system_visual;
VisualID rgba_visual;
VisualID system_visual;
VisualID rgba_visual;
#endif
// Note: when adding new members, please remember to update EnumerateFields
// in gpu_info.cc.
// In conjunction with EnumerateFields, this allows the embedder to
// enumerate the values in this structure without having to embed
// references to its specific member variables. This simplifies the
// addition of new fields to this type.
class Enumerator
{
public:
// The following methods apply to the "current" object. Initially this
// is the root object, but calls to BeginGPUDevice/EndGPUDevice and
// BeginAuxAttributes/EndAuxAttributes change the object to which these
// calls should apply.
virtual void AddInt64(const char *name, int64_t value) = 0;
virtual void AddInt(const char *name, int value) = 0;
virtual void AddString(const char *name, const std::string &value) = 0;
virtual void AddBool(const char *name, bool value) = 0;
virtual void AddTimeDeltaInSecondsF(const char *name, const base::TimeDelta &value) = 0;
// Markers indicating that a GPUDevice is being described.
virtual void BeginGPUDevice() = 0;
virtual void EndGPUDevice() = 0;
// Markers indicating that a VideoDecodeAcceleratorSupportedProfile is
// being described.
virtual void BeginVideoDecodeAcceleratorSupportedProfile() = 0;
virtual void EndVideoDecodeAcceleratorSupportedProfile() = 0;
// Markers indicating that a VideoEncodeAcceleratorSupportedProfile is
// being described.
virtual void BeginVideoEncodeAcceleratorSupportedProfile() = 0;
virtual void EndVideoEncodeAcceleratorSupportedProfile() = 0;
// Markers indicating that "auxiliary" attributes of the GPUInfo
// (according to the DevTools protocol) are being described.
virtual void BeginAuxAttributes() = 0;
virtual void EndAuxAttributes() = 0;
protected:
virtual ~Enumerator() {}
};
// Outputs the fields in this structure to the provided enumerator.
void EnumerateFields(Enumerator *enumerator) const;
bool oop_rasterization_supported;
// Note: when adding new members, please remember to update EnumerateFields
// in gpu_info.cc.
// In conjunction with EnumerateFields, this allows the embedder to
// enumerate the values in this structure without having to embed
// references to its specific member variables. This simplifies the
// addition of new fields to this type.
class Enumerator {
public:
// The following methods apply to the "current" object. Initially this
// is the root object, but calls to BeginGPUDevice/EndGPUDevice and
// BeginAuxAttributes/EndAuxAttributes change the object to which these
// calls should apply.
virtual void AddInt64(const char* name, int64_t value) = 0;
virtual void AddInt(const char* name, int value) = 0;
virtual void AddString(const char* name, const std::string& value) = 0;
virtual void AddBool(const char* name, bool value) = 0;
virtual void AddTimeDeltaInSecondsF(const char* name,
const base::TimeDelta& value) = 0;
// Markers indicating that a GPUDevice is being described.
virtual void BeginGPUDevice() = 0;
virtual void EndGPUDevice() = 0;
// Markers indicating that a VideoDecodeAcceleratorSupportedProfile is
// being described.
virtual void BeginVideoDecodeAcceleratorSupportedProfile() = 0;
virtual void EndVideoDecodeAcceleratorSupportedProfile() = 0;
// Markers indicating that a VideoEncodeAcceleratorSupportedProfile is
// being described.
virtual void BeginVideoEncodeAcceleratorSupportedProfile() = 0;
virtual void EndVideoEncodeAcceleratorSupportedProfile() = 0;
// Markers indicating that an ImageDecodeAcceleratorSupportedProfile is
// being described.
virtual void BeginImageDecodeAcceleratorSupportedProfile() = 0;
virtual void EndImageDecodeAcceleratorSupportedProfile() = 0;
// Markers indicating that "auxiliary" attributes of the GPUInfo
// (according to the DevTools protocol) are being described.
virtual void BeginAuxAttributes() = 0;
virtual void EndAuxAttributes() = 0;
virtual void BeginOverlayCapability() = 0;
virtual void EndOverlayCapability() = 0;
virtual void BeginDx12VulkanVersionInfo() = 0;
virtual void EndDx12VulkanVersionInfo() = 0;
protected:
virtual ~Enumerator() = default;
};
// Outputs the fields in this structure to the provided enumerator.
void EnumerateFields(Enumerator* enumerator) const;
};
} // namespace gpu
......
......@@ -99,32 +99,36 @@ GPUTestConfig::OS GetCurrentOS() {
return GPUTestConfig::kOsMacSierra;
case 13:
return GPUTestConfig::kOsMacHighSierra;
case 14:
return GPUTestConfig::kOsMacMojave;
}
}
#elif defined(OS_ANDROID)
return GPUTestConfig::kOsAndroid;
#elif defined(OS_FUCHSIA)
return GPUTestConfig::kOsFuchsia;
#endif
return GPUTestConfig::kOsUnknown;
}
#if !defined(OS_ANDROID)
CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
angle::SystemInfo info;
if (!angle::GetSystemInfo(&info)) {
return kCollectInfoFatalFailure;
return false;
}
const angle::GPUDeviceInfo& gpu = info.gpus[info.primaryGPUIndex];
gpu_info->gpu.vendor_id = gpu.vendorId;
gpu_info->gpu.device_id = gpu.deviceId;
gpu_info->gpu.active = true;
return kCollectInfoSuccess;
return true;
}
#else
CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
gpu_info->gpu.vendor_id = 0;
gpu_info->gpu.device_id = 0;
gpu_info->gpu.active = true;
return kCollectInfoNonFatalFailure;
return false;
}
#endif // defined(OS_ANDROID)
} // namespace anonymous
......@@ -138,11 +142,11 @@ GPUTestConfig::GPUTestConfig()
GPUTestConfig::GPUTestConfig(const GPUTestConfig& other) = default;
GPUTestConfig::~GPUTestConfig() {
}
GPUTestConfig::~GPUTestConfig() = default;
void GPUTestConfig::set_os(int32_t os) {
DCHECK_EQ(0, os & ~(kOsAndroid | kOsWin | kOsMac | kOsLinux | kOsChromeOS));
DCHECK_EQ(0, os & ~(kOsAndroid | kOsWin | kOsMac | kOsLinux | kOsChromeOS |
kOsFuchsia));
os_ = os;
}
......@@ -202,7 +206,7 @@ bool GPUTestConfig::OverlapsWith(const GPUTestConfig& config) const {
(build_type_ & config.build_type_) == 0)
return false;
if (config.api() != kAPIUnknown && api_ != kAPIUnknown && api_ != config.api_)
return false;
return false;
return true;
}
......@@ -214,8 +218,7 @@ void GPUTestConfig::ClearGPUVendor() {
gpu_vendor_.clear();
}
GPUTestBotConfig::~GPUTestBotConfig() {
}
GPUTestBotConfig::~GPUTestBotConfig() = default;
void GPUTestBotConfig::AddGPUVendor(uint32_t gpu_vendor) {
DCHECK_EQ(0u, GPUTestConfig::gpu_vendor().size());
......@@ -248,9 +251,11 @@ bool GPUTestBotConfig::IsValid() const {
case kOsMacElCapitan:
case kOsMacSierra:
case kOsMacHighSierra:
case kOsMacMojave:
case kOsLinux:
case kOsChromeOS:
case kOsAndroid:
case kOsFuchsia:
break;
default:
return false;
......@@ -309,10 +314,9 @@ bool GPUTestBotConfig::Matches(const std::string& config_data) const {
bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo* gpu_info) {
bool rt;
if (gpu_info == NULL) {
if (!gpu_info) {
GPUInfo my_gpu_info;
CollectInfoResult result = CollectBasicGraphicsInfo(&my_gpu_info);
if (result != kCollectInfoSuccess) {
if (!CollectBasicGraphicsInfo(&my_gpu_info)) {
LOG(ERROR) << "Fail to identify GPU\n";
DisableGPUInfoValidation();
rt = true;
......@@ -338,7 +342,7 @@ bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo* gpu_info) {
// static
bool GPUTestBotConfig::CurrentConfigMatches(const std::string& config_data) {
GPUTestBotConfig my_config;
if (!my_config.LoadCurrentConfig(NULL))
if (!my_config.LoadCurrentConfig(nullptr))
return false;
return my_config.Matches(config_data);
}
......@@ -347,7 +351,7 @@ bool GPUTestBotConfig::CurrentConfigMatches(const std::string& config_data) {
bool GPUTestBotConfig::CurrentConfigMatches(
const std::vector<std::string>& configs) {
GPUTestBotConfig my_config;
if (!my_config.LoadCurrentConfig(NULL))
if (!my_config.LoadCurrentConfig(nullptr))
return false;
for (size_t i = 0 ; i < configs.size(); ++i) {
if (my_config.Matches(configs[i]))
......@@ -362,4 +366,3 @@ bool GPUTestBotConfig::GpuBlacklistedOnBot() {
}
} // namespace gpu
......@@ -12,143 +12,140 @@
#include "angle_config.h"
namespace gpu
{
namespace gpu {
struct GPUInfo;
class GPU_EXPORT GPUTestConfig
{
public:
enum OS
{
kOsUnknown = 0,
kOsWinXP = 1 << 0,
kOsWinVista = 1 << 1,
kOsWin7 = 1 << 2,
kOsWin8 = 1 << 3,
kOsMacLeopard = 1 << 4,
kOsMacSnowLeopard = 1 << 5,
kOsMacLion = 1 << 6,
kOsMacMountainLion = 1 << 7,
kOsMacMavericks = 1 << 8,
kOsMacYosemite = 1 << 9,
kOsMacElCapitan = 1 << 10,
kOsMacSierra = 1 << 11,
kOsMacHighSierra = 1 << 12,
kOsMac = kOsMacLeopard | kOsMacSnowLeopard | kOsMacLion | kOsMacMountainLion |
kOsMacMavericks | kOsMacYosemite | kOsMacElCapitan | kOsMacSierra |
kOsMacHighSierra,
kOsLinux = 1 << 13,
kOsChromeOS = 1 << 14,
kOsAndroid = 1 << 15,
kOsWin10 = 1 << 16,
kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8 | kOsWin10,
};
enum BuildType
{
kBuildTypeUnknown = 0,
kBuildTypeRelease = 1 << 0,
kBuildTypeDebug = 1 << 1,
};
enum API
{
kAPIUnknown = 0,
kAPID3D9 = 1 << 0,
kAPID3D11 = 1 << 1,
kAPIGLDesktop = 1 << 2,
kAPIGLES = 1 << 3,
kAPIVulkan = 1 << 4,
};
GPUTestConfig();
GPUTestConfig(const GPUTestConfig &other);
virtual ~GPUTestConfig();
void set_os(int32_t os);
void set_gpu_device_id(uint32_t id);
void set_build_type(int32_t build_type);
void set_api(int32_t api);
virtual void AddGPUVendor(uint32_t gpu_vendor);
int32_t os() const { return os_; }
const std::vector<uint32_t> &gpu_vendor() const { return gpu_vendor_; }
uint32_t gpu_device_id() const { return gpu_device_id_; }
int32_t build_type() const { return build_type_; }
int32_t api() const { return api_; }
// Check if the config is valid. For example, if gpu_device_id_ is set, but
// gpu_vendor_ is unknown, then it's invalid.
virtual bool IsValid() const;
// Check if two configs overlap, i.e., if there exists a config that matches
// both configs.
bool OverlapsWith(const GPUTestConfig &config) const;
// Disable validation of GPU vendor and device ids.
void DisableGPUInfoValidation();
protected:
void ClearGPUVendor();
// Indicates that the OS has the notion of a numeric GPU vendor and device id
// and this data should be validated.
bool validate_gpu_info_;
private:
// operating system.
int32_t os_;
// GPU vendor.
std::vector<uint32_t> gpu_vendor_;
// GPU device id (unique to each vendor).
uint32_t gpu_device_id_;
// Release or Debug.
int32_t build_type_;
// Back-end rendering APIs.
int32_t api_;
class GPU_EXPORT GPUTestConfig {
public:
enum OS {
kOsUnknown = 0,
kOsWinXP = 1 << 0,
kOsWinVista = 1 << 1,
kOsWin7 = 1 << 2,
kOsWin8 = 1 << 3,
kOsMacLeopard = 1 << 4,
kOsMacSnowLeopard = 1 << 5,
kOsMacLion = 1 << 6,
kOsMacMountainLion = 1 << 7,
kOsMacMavericks = 1 << 8,
kOsMacYosemite = 1 << 9,
kOsMacElCapitan = 1 << 10,
kOsMacSierra = 1 << 11,
kOsMacHighSierra = 1 << 12,
kOsMacMojave = 1 << 13,
kOsMac = kOsMacLeopard | kOsMacSnowLeopard | kOsMacLion |
kOsMacMountainLion | kOsMacMavericks | kOsMacYosemite |
kOsMacElCapitan | kOsMacSierra | kOsMacHighSierra | kOsMacMojave,
kOsLinux = 1 << 14,
kOsChromeOS = 1 << 15,
kOsAndroid = 1 << 16,
kOsWin10 = 1 << 17,
kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8 | kOsWin10,
kOsFuchsia = 1 << 18,
};
enum BuildType {
kBuildTypeUnknown = 0,
kBuildTypeRelease = 1 << 0,
kBuildTypeDebug = 1 << 1,
};
enum API {
kAPIUnknown = 0,
kAPID3D9 = 1 << 0,
kAPID3D11 = 1 << 1,
kAPIGLDesktop = 1 << 2,
kAPIGLES = 1 << 3,
kAPIVulkan = 1 << 4,
};
GPUTestConfig();
GPUTestConfig(const GPUTestConfig& other);
virtual ~GPUTestConfig();
void set_os(int32_t os);
void set_gpu_device_id(uint32_t id);
void set_build_type(int32_t build_type);
void set_api(int32_t api);
virtual void AddGPUVendor(uint32_t gpu_vendor);
int32_t os() const { return os_; }
const std::vector<uint32_t>& gpu_vendor() const { return gpu_vendor_; }
uint32_t gpu_device_id() const { return gpu_device_id_; }
int32_t build_type() const { return build_type_; }
int32_t api() const { return api_; }
// Check if the config is valid. For example, if gpu_device_id_ is set, but
// gpu_vendor_ is unknown, then it's invalid.
virtual bool IsValid() const;
// Check if two configs overlap, i.e., if there exists a config that matches
// both configs.
bool OverlapsWith(const GPUTestConfig& config) const;
// Disable validation of GPU vendor and device ids.
void DisableGPUInfoValidation();
protected:
void ClearGPUVendor();
// Indicates that the OS has the notion of a numeric GPU vendor and device id
// and this data should be validated.
bool validate_gpu_info_;
private:
// operating system.
int32_t os_;
// GPU vendor.
std::vector<uint32_t> gpu_vendor_;
// GPU device id (unique to each vendor).
uint32_t gpu_device_id_;
// Release or Debug.
int32_t build_type_;
// Back-end rendering APIs.
int32_t api_;
};
class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig
{
public:
GPUTestBotConfig() {}
~GPUTestBotConfig() override;
class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig {
public:
GPUTestBotConfig() = default;
~GPUTestBotConfig() override;
// This should only be called when no gpu_vendor is added.
void AddGPUVendor(uint32_t gpu_vendor) override;
// This should only be called when no gpu_vendor is added.
void AddGPUVendor(uint32_t gpu_vendor) override;
// Return false if gpu_info does not have valid vendor_id and device_id.
bool SetGPUInfo(const GPUInfo &gpu_info);
// Return false if gpu_info does not have valid vendor_id and device_id.
bool SetGPUInfo(const GPUInfo& gpu_info);
// Check if the bot config is valid, i.e., if it is one valid test-bot
// environment. For example, if a field is unknown, or if OS is not one
// fully defined OS, then it's valid.
bool IsValid() const override;
// Check if the bot config is valid, i.e., if it is one valid test-bot
// environment. For example, if a field is unknown, or if OS is not one
// fully defined OS, then it's valid.
bool IsValid() const override;
// Check if a bot config matches a test config, i.e., the test config is a
// superset of the bot config.
bool Matches(const GPUTestConfig &config) const;
bool Matches(const std::string &config_data) const;
// Check if a bot config matches a test config, i.e., the test config is a
// superset of the bot config.
bool Matches(const GPUTestConfig& config) const;
bool Matches(const std::string& config_data) const;
// Setup the config with the current gpu testing environment.
// If gpu_info is NULL, collect GPUInfo first.
bool LoadCurrentConfig(const GPUInfo *gpu_info);
// Setup the config with the current gpu testing environment.
// If gpu_info is nullptr, collect GPUInfo first.
bool LoadCurrentConfig(const GPUInfo* gpu_info);
// Check if this bot's config matches |config_data| or any of the |configs|.
static bool CurrentConfigMatches(const std::string &config_data);
static bool CurrentConfigMatches(const std::vector<std::string> &configs);
// Check if this bot's config matches |config_data| or any of the |configs|.
static bool CurrentConfigMatches(const std::string& config_data);
static bool CurrentConfigMatches(const std::vector<std::string>& configs);
// Check if the bot has blacklisted all GPU features.
static bool GpuBlacklistedOnBot();
// Check if the bot has blacklisted all GPU features.
static bool GpuBlacklistedOnBot();
};
} // namespace gpu
#endif // ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_
......@@ -75,6 +75,7 @@ enum Token {
kConfigMacElCapitan,
kConfigMacSierra,
kConfigMacHighSierra,
kConfigMacMojave,
kConfigMac,
kConfigLinux,
kConfigChromeOS,
......@@ -132,6 +133,7 @@ const TokenInfo kTokenData[] = {
{"elcapitan", GPUTestConfig::kOsMacElCapitan},
{"sierra", GPUTestConfig::kOsMacSierra},
{"highsierra", GPUTestConfig::kOsMacHighSierra},
{"mojave", GPUTestConfig::kOsMacMojave},
{"mac", GPUTestConfig::kOsMac},
{"linux", GPUTestConfig::kOsLinux},
{"chromeos", GPUTestConfig::kOsChromeOS},
......@@ -221,8 +223,7 @@ GPUTestExpectationsParser::GPUTestExpectationsParser() {
sizeof(kErrorMessage) / sizeof(kErrorMessage[0]));
}
GPUTestExpectationsParser::~GPUTestExpectationsParser() {
}
GPUTestExpectationsParser::~GPUTestExpectationsParser() = default;
bool GPUTestExpectationsParser::LoadTestExpectations(const std::string& data) {
entries_.clear();
......@@ -297,6 +298,7 @@ bool GPUTestExpectationsParser::ParseConfig(
case kConfigMacElCapitan:
case kConfigMacSierra:
case kConfigMacHighSierra:
case kConfigMacMojave:
case kConfigMac:
case kConfigLinux:
case kConfigChromeOS:
......@@ -359,6 +361,7 @@ bool GPUTestExpectationsParser::ParseLine(
case kConfigMacElCapitan:
case kConfigMacSierra:
case kConfigMacHighSierra:
case kConfigMacMojave:
case kConfigMac:
case kConfigLinux:
case kConfigChromeOS:
......@@ -484,6 +487,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig* config,
case kConfigMacElCapitan:
case kConfigMacSierra:
case kConfigMacHighSierra:
case kConfigMacMojave:
case kConfigMac:
case kConfigLinux:
case kConfigChromeOS:
......
......@@ -14,78 +14,77 @@
#include "angle_config.h"
#include "gpu_test_config.h"
namespace gpu
{
class GPU_EXPORT GPUTestExpectationsParser
{
public:
enum GPUTestExpectation
{
kGpuTestPass = 1 << 0,
kGpuTestFail = 1 << 1,
kGpuTestFlaky = 1 << 2,
kGpuTestTimeout = 1 << 3,
kGpuTestSkip = 1 << 4,
};
GPUTestExpectationsParser();
~GPUTestExpectationsParser();
// Parse the text expectations, and if no error is encountered,
// save all the entries. Otherwise, generate error messages.
// Return true if parsing succeeds.
bool LoadTestExpectations(const std::string &data);
bool LoadTestExpectationsFromFile(const std::string &path);
// Query error messages from the last LoadTestExpectations() call.
const std::vector<std::string> &GetErrorMessages() const;
// Get the test expectation of a given test on a given bot.
int32_t GetTestExpectation(const std::string &test_name,
const GPUTestBotConfig &bot_config) const;
// Parse a list of config modifiers. If we have a valid entry with no
// conflicts, | config | stores it, and the function returns true.
bool ParseConfig(const std::string &config_data, GPUTestConfig *config);
private:
struct GPUTestExpectationEntry
{
GPUTestExpectationEntry();
std::string test_name;
GPUTestConfig test_config;
int32_t test_expectation;
size_t line_number;
};
// Parse a line of text. If we have a valid entry, save it; otherwise,
// generate error messages.
bool ParseLine(const std::string &line_data, size_t line_number);
// Update OS/GPUVendor/BuildType modifiers. May generate an error message.
bool UpdateTestConfig(GPUTestConfig *config, int32_t token, size_t line_number);
// Update GPUDeviceID modifier. May generate an error message.
bool UpdateTestConfig(GPUTestConfig *config,
const std::string &gpu_device_id,
size_t line_number);
// Check if two entries' config overlap with each other. May generate an
// error message.
bool DetectConflictsBetweenEntries();
// Save an error message, which can be queried later.
void PushErrorMessage(const std::string &message, size_t line_number);
void PushErrorMessage(const std::string &message,
size_t entry1_line_number,
size_t entry2_line_number);
std::vector<GPUTestExpectationEntry> entries_;
std::vector<std::string> error_messages_;
namespace gpu {
class GPU_EXPORT GPUTestExpectationsParser {
public:
enum GPUTestExpectation {
kGpuTestPass = 1 << 0,
kGpuTestFail = 1 << 1,
kGpuTestFlaky = 1 << 2,
kGpuTestTimeout = 1 << 3,
kGpuTestSkip = 1 << 4,
};
GPUTestExpectationsParser();
~GPUTestExpectationsParser();
// Parse the text expectations, and if no error is encountered,
// save all the entries. Otherwise, generate error messages.
// Return true if parsing succeeds.
bool LoadTestExpectations(const std::string& data);
bool LoadTestExpectationsFromFile(const std::string& path);
// Query error messages from the last LoadTestExpectations() call.
const std::vector<std::string>& GetErrorMessages() const;
// Get the test expectation of a given test on a given bot.
int32_t GetTestExpectation(const std::string& test_name,
const GPUTestBotConfig& bot_config) const;
// Parse a list of config modifiers. If we have a valid entry with no
// conflicts, | config | stores it, and the function returns true.
bool ParseConfig(const std::string& config_data, GPUTestConfig* config);
private:
struct GPUTestExpectationEntry {
GPUTestExpectationEntry();
std::string test_name;
GPUTestConfig test_config;
int32_t test_expectation;
size_t line_number;
};
// Parse a line of text. If we have a valid entry, save it; otherwise,
// generate error messages.
bool ParseLine(const std::string& line_data, size_t line_number);
// Update OS/GPUVendor/BuildType modifiers. May generate an error message.
bool UpdateTestConfig(GPUTestConfig* config,
int32_t token,
size_t line_number);
// Update GPUDeviceID modifier. May generate an error message.
bool UpdateTestConfig(GPUTestConfig* config,
const std::string & gpu_device_id,
size_t line_number);
// Check if two entries' config overlap with each other. May generate an
// error message.
bool DetectConflictsBetweenEntries();
// Save an error message, which can be queried later.
void PushErrorMessage(const std::string& message, size_t line_number);
void PushErrorMessage(const std::string& message,
size_t entry1_line_number,
size_t entry2_line_number);
std::vector<GPUTestExpectationEntry> entries_;
std::vector<std::string> error_messages_;
};
} // namespace gpu
#endif // ANGLE_GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment