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_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 @@ @@ -0,0 +1,22 @@
+Because the ```gpu_test_expectations``` directory is based on parts of Chromium's ```gpu/config``` +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 +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 ...@@ -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 diff HEAD~ (`)ls(`) > angle-mods.patch```,```git add angle-mods.patch```, ```git commit --amend```
+ * ```git rebase -i``` to squash the three patches into one. + * ```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_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 +++ gpu_test_expectations/angle_config.h 2019-03-01 14:22:15.015379305 -0500
@@ -0,0 +1,73 @@ @@ -0,0 +1,74 @@
+// +//
+// Copyright 2015 The ANGLE Project Authors. All rights reserved. +// Copyright 2015 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be +// 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 ...@@ -47,10 +47,11 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/angle_config.h gpu
+#include "common/debug.h" +#include "common/debug.h"
+#include "common/string_utils.h" +#include "common/string_utils.h"
+ +
+#define DCHECK_EQ(A,B) ASSERT((A) == (B)) +#define DCHECK_EQ(A, B) ASSERT((A) == (B))
+#define DCHECK_NE(A,B) ASSERT((A) != (B)) +#define DCHECK_NE(A, B) ASSERT((A) != (B))
+#define DCHECK(X) ASSERT(X) +#define DCHECK(X) ASSERT(X)
+#define DLOG(X) std::cerr +#define DLOG(X) std::cerr
+#define DVLOG(X) std::cerr
+#define LOG(X) std::cerr +#define LOG(X) std::cerr
+ +
+#define GPU_EXPORT +#define GPU_EXPORT
...@@ -58,32 +59,32 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/angle_config.h gpu ...@@ -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 +// Shim Chromium's types by importing symbols in the correct namespaces
+namespace base +namespace base
+{ +{
+ using angle::kWhitespaceASCII; +using angle::HexStringToUInt;
+ using angle::TRIM_WHITESPACE; +using angle::KEEP_WHITESPACE;
+ using angle::KEEP_WHITESPACE; +using angle::kWhitespaceASCII;
+ using angle::SPLIT_WANT_ALL; +using angle::ReadFileToString;
+ using angle::SPLIT_WANT_NONEMPTY; +using angle::SPLIT_WANT_ALL;
+ using angle::SplitString; +using angle::SPLIT_WANT_NONEMPTY;
+ using angle::SplitStringAlongWhitespace; +using angle::SplitString;
+ using angle::HexStringToUInt; +using angle::SplitStringAlongWhitespace;
+ using angle::ReadFileToString; +using angle::TRIM_WHITESPACE;
+ +
+ using TimeDelta = int; +using TimeDelta = int;
+} // namespace base +} // namespace base
+ +
+namespace gfx +namespace gfx
+{ +{
+ class Size +class Size
+ { +{
+ public: + public:
+ int width() const { return 0; } + int width() const { return 0; }
+ int height() const { return 0; } + int height() const { return 0; }
+ }; + std::string ToString() const { return "0x0"; }
+};
+} // namespace gfx +} // namespace gfx
+ +
+struct DxDiagNode +struct DxDiagNode
+{ +{};
+};
+ +
+// TODO(jmadill): other platforms +// TODO(jmadill): other platforms
+// clang-format off +// clang-format off
...@@ -101,9 +102,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/angle_config.h gpu ...@@ -101,9 +102,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/angle_config.h gpu
+// clang-format on +// clang-format on
+ +
+#endif +#endif
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_info.cc gpu_test_expectations/gpu_info.cc diff -rupN 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_reverted/gpu_info.cc 2019-03-01 12:42:46.241215684 -0500
+++ gpu_test_expectations/gpu_info.cc 2017-10-23 13:31:30.199473500 -0400 +++ gpu_test_expectations/gpu_info.cc 2019-03-01 14:22:15.015379305 -0500
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
#include <stdint.h> #include <stdint.h>
...@@ -113,18 +114,18 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_info.cc gpu_te ...@@ -113,18 +114,18 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_info.cc gpu_te
namespace { namespace {
@@ -100,7 +100,7 @@ const GPUInfo::GPUDevice& GPUInfo::activ @@ -214,7 +214,7 @@ const GPUInfo::GPUDevice& GPUInfo::activ
if (secondary_gpu.active) if (secondary_gpu.active)
return secondary_gpu; return secondary_gpu;
} }
- DLOG(ERROR) << "No active GPU found, returning primary GPU."; - DVLOG(2) << "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.\n";
return gpu; return gpu;
} }
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_info.h gpu_test_expectations/gpu_info.h diff -rupN 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_reverted/gpu_info.h 2019-03-01 12:43:15.585224456 -0500
+++ gpu_test_expectations/gpu_info.h 2017-10-23 13:31:30.199473500 -0400 +++ gpu_test_expectations/gpu_info.h 2019-03-01 14:22:15.015379305 -0500
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -150,16 +151,16 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_info.h gpu_tes ...@@ -150,16 +151,16 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_info.h gpu_tes
#if defined(USE_X11) #if defined(USE_X11)
typedef unsigned long VisualID; typedef unsigned long VisualID;
@@ -299,4 +294,4 @@ struct GPU_EXPORT GPUInfo { @@ -403,4 +398,4 @@ struct GPU_EXPORT GPUInfo {
} // namespace gpu } // namespace gpu
-#endif // GPU_CONFIG_GPU_INFO_H_ -#endif // GPU_CONFIG_GPU_INFO_H_
+#endif // ANGLE_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 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 2018-01-29 15:22:50.938244500 -0500 --- gpu_test_expectations_reverted/gpu_test_config.cc 2019-03-01 12:51:43.713376340 -0500
+++ gpu_test_expectations/gpu_test_config.cc 2018-01-29 15:41:35.330454900 -0500 +++ gpu_test_expectations/gpu_test_config.cc 2019-03-01 14:22:15.015379305 -0500
@@ -2,21 +2,53 @@ @@ -2,22 +2,53 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -170,7 +171,8 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc ...@@ -170,7 +171,8 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc
#include <stdint.h> #include <stdint.h>
-#include "base/logging.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.h"
-#include "gpu/config/gpu_info_collector.h" -#include "gpu/config/gpu_info_collector.h"
-#include "gpu/config/gpu_test_expectations_parser.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 ...@@ -221,7 +223,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc
namespace gpu { namespace gpu {
namespace { namespace {
@@ -46,8 +78,7 @@ GPUTestConfig::OS GetCurrentOS() { @@ -47,8 +78,7 @@ GPUTestConfig::OS GetCurrentOS() {
int32_t major_version = 0; int32_t major_version = 0;
int32_t minor_version = 0; int32_t minor_version = 0;
int32_t bugfix_version = 0; int32_t bugfix_version = 0;
...@@ -231,34 +233,34 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc ...@@ -231,34 +233,34 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc
if (major_version == 10) { if (major_version == 10) {
switch (minor_version) { switch (minor_version) {
case 5: case 5:
@@ -76,6 +107,26 @@ GPUTestConfig::OS GetCurrentOS() { @@ -81,6 +111,26 @@ GPUTestConfig::OS GetCurrentOS() {
return GPUTestConfig::kOsUnknown; return GPUTestConfig::kOsUnknown;
} }
+#if !defined(OS_ANDROID) +#if !defined(OS_ANDROID)
+CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) { +bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
+ angle::SystemInfo info; + angle::SystemInfo info;
+ if (!angle::GetSystemInfo(&info)) { + if (!angle::GetSystemInfo(&info)) {
+ return kCollectInfoFatalFailure; + return false;
+ } + }
+ const angle::GPUDeviceInfo& gpu = info.gpus[info.primaryGPUIndex]; + const angle::GPUDeviceInfo& gpu = info.gpus[info.primaryGPUIndex];
+ gpu_info->gpu.vendor_id = gpu.vendorId; + gpu_info->gpu.vendor_id = gpu.vendorId;
+ gpu_info->gpu.device_id = gpu.deviceId; + gpu_info->gpu.device_id = gpu.deviceId;
+ gpu_info->gpu.active = true; + gpu_info->gpu.active = true;
+ return kCollectInfoSuccess; + return true;
+} +}
+#else +#else
+CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) { +bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
+ gpu_info->gpu.vendor_id = 0; + gpu_info->gpu.vendor_id = 0;
+ gpu_info->gpu.device_id = 0; + gpu_info->gpu.device_id = 0;
+ gpu_info->gpu.active = true; + gpu_info->gpu.active = true;
+ return kCollectInfoNonFatalFailure; + return false;
+} +}
+#endif // defined(OS_ANDROID) +#endif // defined(OS_ANDROID)
} // namespace anonymous } // namespace anonymous
GPUTestConfig::GPUTestConfig() 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) { void GPUTestConfig::set_api(int32_t api) {
...@@ -267,16 +269,16 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc ...@@ -267,16 +269,16 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc
api_ = api; api_ = api;
} }
@@ -260,7 +311,7 @@ bool GPUTestBotConfig::LoadCurrentConfig @@ -261,7 +311,7 @@ bool GPUTestBotConfig::LoadCurrentConfig
#else
GPUInfo my_gpu_info; GPUInfo my_gpu_info;
CollectInfoResult result = CollectBasicGraphicsInfo(&my_gpu_info); if (!CollectBasicGraphicsInfo(&my_gpu_info)) {
if (result != kCollectInfoSuccess) {
- LOG(ERROR) << "Fail to identify GPU"; - LOG(ERROR) << "Fail to identify GPU";
+ LOG(ERROR) << "Fail to identify GPU\n"; + LOG(ERROR) << "Fail to identify GPU\n";
DisableGPUInfoValidation(); rt = false;
rt = true;
} else { } else {
@@ -271,7 +322,7 @@ bool GPUTestBotConfig::LoadCurrentConfig rt = SetGPUInfo(my_gpu_info);
@@ -272,7 +322,7 @@ bool GPUTestBotConfig::LoadCurrentConfig
} }
set_os(GetCurrentOS()); set_os(GetCurrentOS());
if (os() == kOsUnknown) { if (os() == kOsUnknown) {
...@@ -285,9 +287,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc ...@@ -285,9 +287,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.cc
rt = false; rt = false;
} }
#if defined(NDEBUG) #if defined(NDEBUG)
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.h gpu_test_expectations/gpu_test_config.h 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 2018-01-29 15:22:50.941246600 -0500 --- gpu_test_expectations_reverted/gpu_test_config.h 2019-03-01 12:49:49.793342296 -0500
+++ gpu_test_expectations/gpu_test_config.h 2018-01-29 15:41:01.117639000 -0500 +++ gpu_test_expectations/gpu_test_config.h 2019-03-01 14:22:15.015379305 -0500
@@ -2,16 +2,15 @@ @@ -2,16 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -308,7 +310,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.h ...@@ -308,7 +310,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.h
namespace gpu { namespace gpu {
@@ -56,6 +55,7 @@ class GPU_EXPORT GPUTestConfig { @@ -58,6 +57,7 @@ class GPU_EXPORT GPUTestConfig {
kAPID3D11 = 1 << 1, kAPID3D11 = 1 << 1,
kAPIGLDesktop = 1 << 2, kAPIGLDesktop = 1 << 2,
kAPIGLES = 1 << 3, kAPIGLES = 1 << 3,
...@@ -316,16 +318,16 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.h ...@@ -316,16 +318,16 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config.h
}; };
GPUTestConfig(); GPUTestConfig();
@@ -145,5 +145,5 @@ class GPU_EXPORT GPUTestBotConfig : publ @@ -140,5 +140,5 @@ class GPU_EXPORT GPUTestBotConfig : publ
} // namespace gpu } // namespace gpu
-#endif // GPU_CONFIG_GPU_TEST_CONFIG_H_ -#endif // GPU_CONFIG_GPU_TEST_CONFIG_H_
+#endif // ANGLE_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_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 @@ @@ -0,0 +1,24 @@
+// +//
+// Copyright 2015 The ANGLE Project Authors. All rights reserved. +// Copyright 2015 The ANGLE Project Authors. All rights reserved.
...@@ -351,9 +353,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config_ma ...@@ -351,9 +353,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config_ma
+} // namespace angle +} // namespace angle
+ +
+#endif // ANGLE_GPU_TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_ +#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 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_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 @@ @@ -0,0 +1,49 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be +// 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 ...@@ -404,9 +406,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_config_ma
+} +}
+ +
+} // namespace angle +} // namespace angle
diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectations_parser.cc gpu_test_expectations/gpu_test_expectations_parser.cc 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 2018-01-29 15:22:50.947689800 -0500 --- 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 2018-01-29 15:42:52.940626000 -0500 +++ gpu_test_expectations/gpu_test_expectations_parser.cc 2019-03-01 14:22:15.015379305 -0500
@@ -2,17 +2,47 @@ @@ -2,17 +2,47 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -462,7 +464,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati ...@@ -462,7 +464,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
namespace gpu { namespace gpu {
@@ -62,6 +92,7 @@ enum Token { @@ -63,6 +93,7 @@ enum Token {
kConfigD3D11, kConfigD3D11,
kConfigGLDesktop, kConfigGLDesktop,
kConfigGLES, kConfigGLES,
...@@ -470,7 +472,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati ...@@ -470,7 +472,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
// expectation // expectation
kExpectationPass, kExpectationPass,
kExpectationFail, kExpectationFail,
@@ -115,6 +146,7 @@ const TokenInfo kTokenData[] = { @@ -117,6 +148,7 @@ const TokenInfo kTokenData[] = {
{"d3d11", GPUTestConfig::kAPID3D11}, {"d3d11", GPUTestConfig::kAPID3D11},
{"opengl", GPUTestConfig::kAPIGLDesktop}, {"opengl", GPUTestConfig::kAPIGLDesktop},
{"gles", GPUTestConfig::kAPIGLES}, {"gles", GPUTestConfig::kAPIGLES},
...@@ -478,7 +480,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati ...@@ -478,7 +480,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
{"pass", GPUTestExpectationsParser::kGpuTestPass}, {"pass", GPUTestExpectationsParser::kGpuTestPass},
{"fail", GPUTestExpectationsParser::kGpuTestFail}, {"fail", GPUTestExpectationsParser::kGpuTestFail},
{"flaky", GPUTestExpectationsParser::kGpuTestFlaky}, {"flaky", GPUTestExpectationsParser::kGpuTestFlaky},
@@ -153,9 +185,9 @@ const char* kErrorMessage[] = { @@ -155,9 +187,9 @@ const char* kErrorMessage[] = {
}; };
Token ParseToken(const std::string& word) { Token ParseToken(const std::string& word) {
...@@ -490,7 +492,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati ...@@ -490,7 +492,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
return kConfigGPUDeviceID; return kConfigGPUDeviceID;
for (int32_t i = 0; i < kNumberOfExactMatchTokens; ++i) { for (int32_t i = 0; i < kNumberOfExactMatchTokens; ++i) {
@@ -211,8 +243,8 @@ bool GPUTestExpectationsParser::LoadTest @@ -212,8 +244,8 @@ bool GPUTestExpectationsParser::LoadTest
return rt; return rt;
} }
...@@ -501,7 +503,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati ...@@ -501,7 +503,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
entries_.clear(); entries_.clear();
error_messages_.clear(); error_messages_.clear();
@@ -279,6 +311,7 @@ bool GPUTestExpectationsParser::ParseCon @@ -281,6 +313,7 @@ bool GPUTestExpectationsParser::ParseCon
case kConfigD3D11: case kConfigD3D11:
case kConfigGLDesktop: case kConfigGLDesktop:
case kConfigGLES: case kConfigGLES:
...@@ -509,7 +511,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati ...@@ -509,7 +511,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
case kConfigGPUDeviceID: case kConfigGPUDeviceID:
if (token == kConfigGPUDeviceID) { if (token == kConfigGPUDeviceID) {
if (!UpdateTestConfig(config, tokens[i], 0)) if (!UpdateTestConfig(config, tokens[i], 0))
@@ -340,6 +373,7 @@ bool GPUTestExpectationsParser::ParseLin @@ -343,6 +376,7 @@ bool GPUTestExpectationsParser::ParseLin
case kConfigD3D11: case kConfigD3D11:
case kConfigGLDesktop: case kConfigGLDesktop:
case kConfigGLES: case kConfigGLES:
...@@ -517,7 +519,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati ...@@ -517,7 +519,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
case kConfigGPUDeviceID: case kConfigGPUDeviceID:
// MODIFIERS, could be in any order, need at least one. // MODIFIERS, could be in any order, need at least one.
if (stage != kLineParserConfigs && stage != kLineParserBugID) { if (stage != kLineParserConfigs && stage != kLineParserBugID) {
@@ -493,6 +527,7 @@ bool GPUTestExpectationsParser::UpdateTe @@ -497,6 +531,7 @@ bool GPUTestExpectationsParser::UpdateTe
case kConfigD3D11: case kConfigD3D11:
case kConfigGLDesktop: case kConfigGLDesktop:
case kConfigGLES: case kConfigGLES:
...@@ -525,7 +527,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati ...@@ -525,7 +527,7 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
if ((config->api() & kTokenData[token].flag) != 0) { if ((config->api() & kTokenData[token].flag) != 0) {
PushErrorMessage(kErrorMessage[kErrorEntryWithAPIConflicts], PushErrorMessage(kErrorMessage[kErrorEntryWithAPIConflicts],
line_number); line_number);
@@ -542,20 +577,17 @@ bool GPUTestExpectationsParser::DetectCo @@ -546,20 +581,17 @@ bool GPUTestExpectationsParser::DetectCo
void GPUTestExpectationsParser::PushErrorMessage( void GPUTestExpectationsParser::PushErrorMessage(
const std::string& message, size_t line_number) { const std::string& message, size_t line_number) {
...@@ -551,9 +553,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati ...@@ -551,9 +553,9 @@ diff -rupN --strip-trailing-cr gpu_test_expectations_reverted/gpu_test_expectati
} }
GPUTestExpectationsParser:: GPUTestExpectationEntry::GPUTestExpectationEntry() 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 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 2018-01-29 15:22:50.951678900 -0500 --- 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 2017-09-11 17:09:26.897372200 -0400 +++ gpu_test_expectations/gpu_test_expectations_parser.h 2019-03-01 13:04:50.721621228 -0500
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#define DCHECK_NE(A, B) ASSERT((A) != (B)) #define DCHECK_NE(A, B) ASSERT((A) != (B))
#define DCHECK(X) ASSERT(X) #define DCHECK(X) ASSERT(X)
#define DLOG(X) std::cerr #define DLOG(X) std::cerr
#define DVLOG(X) std::cerr
#define LOG(X) std::cerr #define LOG(X) std::cerr
#define GPU_EXPORT #define GPU_EXPORT
...@@ -48,6 +49,7 @@ class Size ...@@ -48,6 +49,7 @@ class Size
public: public:
int width() const { return 0; } int width() const { return 0; }
int height() const { return 0; } int height() const { return 0; }
std::string ToString() const { return "0x0"; }
}; };
} // namespace gfx } // namespace gfx
...@@ -64,6 +66,8 @@ struct DxDiagNode ...@@ -64,6 +66,8 @@ struct DxDiagNode
# define OS_LINUX # define OS_LINUX
#elif defined(__APPLE__) #elif defined(__APPLE__)
# define OS_MACOSX # define OS_MACOSX
#elif defined(__Fuchsia__)
# define OS_FUCHSIA
#else #else
# error "Unsupported platform" # error "Unsupported platform"
#endif #endif
......
...@@ -16,6 +16,11 @@ void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice& device, ...@@ -16,6 +16,11 @@ void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice& device,
enumerator->AddBool("active", device.active); enumerator->AddBool("active", device.active);
enumerator->AddString("vendorString", device.vendor_string); enumerator->AddString("vendorString", device.vendor_string);
enumerator->AddString("deviceString", device.device_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(); enumerator->EndGPUDevice();
} }
...@@ -45,25 +50,136 @@ void EnumerateVideoEncodeAcceleratorSupportedProfile( ...@@ -45,25 +50,136 @@ void EnumerateVideoEncodeAcceleratorSupportedProfile(
enumerator->EndVideoEncodeAcceleratorSupportedProfile(); 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
namespace gpu { 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() VideoDecodeAcceleratorCapabilities::VideoDecodeAcceleratorCapabilities()
: flags(0) {} : flags(0) {}
VideoDecodeAcceleratorCapabilities::VideoDecodeAcceleratorCapabilities( VideoDecodeAcceleratorCapabilities::VideoDecodeAcceleratorCapabilities(
const VideoDecodeAcceleratorCapabilities& other) = default; 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() GPUInfo::GPUDevice::GPUDevice()
: vendor_id(0), : vendor_id(0),
device_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::GPUDevice(GPUInfo::GPUDevice&& other) noexcept = default;
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() GPUInfo::GPUInfo()
: optimus(false), : optimus(false),
...@@ -72,38 +188,40 @@ GPUInfo::GPUInfo() ...@@ -72,38 +188,40 @@ GPUInfo::GPUInfo()
software_rendering(false), software_rendering(false),
direct_rendering(true), direct_rendering(true),
sandboxed(false), sandboxed(false),
process_crash_count(0),
in_process_gpu(true), in_process_gpu(true),
passthrough_cmd_decoder(false), passthrough_cmd_decoder(false),
basic_info_state(kCollectInfoNone), jpeg_decode_accelerator_supported(false),
context_info_state(kCollectInfoNone),
#if defined(OS_WIN)
dx_diagnostics_info_state(kCollectInfoNone),
#endif
jpeg_decode_accelerator_supported(false)
#if defined(USE_X11) #if defined(USE_X11)
,
system_visual(0), system_visual(0),
rgba_visual(0) rgba_visual(0),
#endif #endif
{ oop_rasterization_supported(false) {
} }
GPUInfo::GPUInfo(const GPUInfo& other) = default; 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 { const GPUInfo::GPUDevice& GPUInfo::active_gpu() const {
if (gpu.active) if (gpu.active || secondary_gpus.empty())
return gpu; return gpu;
for (const GPUDevice& secondary_gpu : secondary_gpus) { for (const auto& secondary_gpu : secondary_gpus) {
if (secondary_gpu.active) if (secondary_gpu.active)
return secondary_gpu; 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; return gpu;
} }
bool GPUInfo::IsInitialized() const {
return gpu.vendor_id != 0 || !gl_vendor.empty();
}
void GPUInfo::EnumerateFields(Enumerator* enumerator) const { void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
struct GPUInfoKnownFields { struct GPUInfoKnownFields {
base::TimeDelta initialization_time; base::TimeDelta initialization_time;
...@@ -111,9 +229,6 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { ...@@ -111,9 +229,6 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
bool amd_switchable; bool amd_switchable;
GPUDevice gpu; GPUDevice gpu;
std::vector<GPUDevice> secondary_gpus; std::vector<GPUDevice> secondary_gpus;
std::string driver_vendor;
std::string driver_version;
std::string driver_date;
std::string pixel_shader_version; std::string pixel_shader_version;
std::string vertex_shader_version; std::string vertex_shader_version;
std::string max_msaa_samples; std::string max_msaa_samples;
...@@ -130,25 +245,31 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { ...@@ -130,25 +245,31 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
bool software_rendering; bool software_rendering;
bool direct_rendering; bool direct_rendering;
bool sandboxed; bool sandboxed;
int process_crash_count;
bool in_process_gpu; bool in_process_gpu;
bool passthrough_cmd_decoder; bool passthrough_cmd_decoder;
bool supports_overlays;
bool can_support_threaded_texture_mailbox; bool can_support_threaded_texture_mailbox;
CollectInfoResult basic_info_state;
CollectInfoResult context_info_state;
#if defined(OS_WIN) #if defined(OS_WIN)
CollectInfoResult dx_diagnostics_info_state; bool direct_composition;
bool supports_overlays;
OverlayCapabilities overlay_capabilities;
DxDiagNode dx_diagnostics; DxDiagNode dx_diagnostics;
Dx12VulkanVersionInfo dx12_vulkan_version_info;
#endif #endif
VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities; VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities;
VideoEncodeAcceleratorSupportedProfiles VideoEncodeAcceleratorSupportedProfiles
video_encode_accelerator_supported_profiles; video_encode_accelerator_supported_profiles;
bool jpeg_decode_accelerator_supported; bool jpeg_decode_accelerator_supported;
ImageDecodeAcceleratorSupportedProfiles
image_decode_accelerator_supported_profiles;
#if defined(USE_X11) #if defined(USE_X11)
VisualID system_visual; VisualID system_visual;
VisualID rgba_visual; VisualID rgba_visual;
#endif #endif
bool oop_rasterization_supported;
}; };
// If this assert fails then most likely something below needs to be updated. // If this assert fails then most likely something below needs to be updated.
...@@ -162,7 +283,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { ...@@ -162,7 +283,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
enumerator->AddString("machineModelName", machine_model_name); enumerator->AddString("machineModelName", machine_model_name);
enumerator->AddString("machineModelVersion", machine_model_version); enumerator->AddString("machineModelVersion", machine_model_version);
EnumerateGPUDevice(gpu, enumerator); EnumerateGPUDevice(gpu, enumerator);
for (const auto& secondary_gpu: secondary_gpus) for (const auto& secondary_gpu : secondary_gpus)
EnumerateGPUDevice(secondary_gpu, enumerator); EnumerateGPUDevice(secondary_gpu, enumerator);
enumerator->BeginAuxAttributes(); enumerator->BeginAuxAttributes();
...@@ -170,9 +291,6 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { ...@@ -170,9 +291,6 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
initialization_time); initialization_time);
enumerator->AddBool("optimus", optimus); enumerator->AddBool("optimus", optimus);
enumerator->AddBool("amdSwitchable", amd_switchable); 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("pixelShaderVersion", pixel_shader_version);
enumerator->AddString("vertexShaderVersion", vertex_shader_version); enumerator->AddString("vertexShaderVersion", vertex_shader_version);
enumerator->AddString("maxMsaaSamples", max_msaa_samples); enumerator->AddString("maxMsaaSamples", max_msaa_samples);
...@@ -190,18 +308,18 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { ...@@ -190,18 +308,18 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
enumerator->AddBool("softwareRendering", software_rendering); enumerator->AddBool("softwareRendering", software_rendering);
enumerator->AddBool("directRendering", direct_rendering); enumerator->AddBool("directRendering", direct_rendering);
enumerator->AddBool("sandboxed", sandboxed); enumerator->AddBool("sandboxed", sandboxed);
enumerator->AddInt("processCrashCount", process_crash_count);
enumerator->AddBool("inProcessGpu", in_process_gpu); enumerator->AddBool("inProcessGpu", in_process_gpu);
enumerator->AddBool("passthroughCmdDecoder", passthrough_cmd_decoder); enumerator->AddBool("passthroughCmdDecoder", passthrough_cmd_decoder);
enumerator->AddBool("supportsOverlays", supports_overlays);
enumerator->AddBool("canSupportThreadedTextureMailbox", enumerator->AddBool("canSupportThreadedTextureMailbox",
can_support_threaded_texture_mailbox); can_support_threaded_texture_mailbox);
enumerator->AddInt("basicInfoState", basic_info_state); // TODO(kbr): add dx_diagnostics on Windows.
enumerator->AddInt("contextInfoState", context_info_state);
#if defined(OS_WIN) #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 #endif
// TODO(kbr): add dx_diagnostics on Windows.
enumerator->AddInt("videoDecodeAcceleratorFlags", enumerator->AddInt("videoDecodeAcceleratorFlags",
video_decode_accelerator_capabilities.flags); video_decode_accelerator_capabilities.flags);
for (const auto& profile : for (const auto& profile :
...@@ -211,10 +329,13 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { ...@@ -211,10 +329,13 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
EnumerateVideoEncodeAcceleratorSupportedProfile(profile, enumerator); EnumerateVideoEncodeAcceleratorSupportedProfile(profile, enumerator);
enumerator->AddBool("jpegDecodeAcceleratorSupported", enumerator->AddBool("jpegDecodeAcceleratorSupported",
jpeg_decode_accelerator_supported); jpeg_decode_accelerator_supported);
for (const auto& profile : image_decode_accelerator_supported_profiles)
EnumerateImageDecodeAcceleratorSupportedProfile(profile, enumerator);
#if defined(USE_X11) #if defined(USE_X11)
enumerator->AddInt64("systemVisual", system_visual); enumerator->AddInt64("systemVisual", system_visual);
enumerator->AddInt64("rgbaVisual", rgba_visual); enumerator->AddInt64("rgbaVisual", rgba_visual);
#endif #endif
enumerator->AddBool("oopRasterizationSupported", oop_rasterization_supported);
enumerator->EndAuxAttributes(); enumerator->EndAuxAttributes();
} }
......
...@@ -19,26 +19,33 @@ ...@@ -19,26 +19,33 @@
typedef unsigned long VisualID; typedef unsigned long VisualID;
#endif #endif
namespace gpu namespace gpu {
{
// These values are persisted to logs. Entries should not be renumbered and
// Result for the various Collect*Info* functions below. // numeric values should never be reused.
// Fatal failures are for cases where we can't create a context at all or enum class GpuSeriesType {
// something, making the use of the GPU impossible. kUnknown = 0,
// Non-fatal failures are for cases where we could gather most info, but maybe // Intel 6th gen
// some is missing (e.g. unable to parse a version string or to detect the exact kIntelSandyBridge = 1,
// model). // Intel 7th gen
enum CollectInfoResult kIntelValleyView = 2, // BayTrail
{ kIntelIvyBridge = 3,
kCollectInfoNone = 0, kIntelHaswell = 4,
kCollectInfoSuccess = 1, // Intel 8th gen
kCollectInfoNonFatalFailure = 2, kIntelCherryView = 5, // Braswell
kCollectInfoFatalFailure = 3 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. // Video profile. This *must* match media::VideoCodecProfile.
enum VideoCodecProfile enum VideoCodecProfile {
{
VIDEO_CODEC_PROFILE_UNKNOWN = -1, VIDEO_CODEC_PROFILE_UNKNOWN = -1,
VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN, VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN,
H264PROFILE_BASELINE = 0, H264PROFILE_BASELINE = 0,
...@@ -65,45 +72,121 @@ enum VideoCodecProfile ...@@ -65,45 +72,121 @@ enum VideoCodecProfile
DOLBYVISION_PROFILE5, DOLBYVISION_PROFILE5,
DOLBYVISION_PROFILE7, DOLBYVISION_PROFILE7,
THEORAPROFILE_ANY, THEORAPROFILE_ANY,
VIDEO_CODEC_PROFILE_MAX = 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. // Specification of a decoding profile supported by a hardware decoder.
struct GPU_EXPORT VideoDecodeAcceleratorSupportedProfile struct GPU_EXPORT VideoDecodeAcceleratorSupportedProfile {
{
VideoCodecProfile profile; VideoCodecProfile profile;
gfx::Size max_resolution; gfx::Size max_resolution;
gfx::Size min_resolution; gfx::Size min_resolution;
bool encrypted_only; bool encrypted_only;
}; };
using VideoDecodeAcceleratorSupportedProfiles = std::vector<VideoDecodeAcceleratorSupportedProfile>; using VideoDecodeAcceleratorSupportedProfiles =
std::vector<VideoDecodeAcceleratorSupportedProfile>;
struct GPU_EXPORT VideoDecodeAcceleratorCapabilities struct GPU_EXPORT VideoDecodeAcceleratorCapabilities {
{
VideoDecodeAcceleratorCapabilities(); VideoDecodeAcceleratorCapabilities();
VideoDecodeAcceleratorCapabilities(const VideoDecodeAcceleratorCapabilities &other); VideoDecodeAcceleratorCapabilities(
const VideoDecodeAcceleratorCapabilities& other);
~VideoDecodeAcceleratorCapabilities(); ~VideoDecodeAcceleratorCapabilities();
VideoDecodeAcceleratorSupportedProfiles supported_profiles; VideoDecodeAcceleratorSupportedProfiles supported_profiles;
uint32_t flags; uint32_t flags;
}; };
// Specification of an encoding profile supported by a hardware encoder. // Specification of an encoding profile supported by a hardware encoder.
struct GPU_EXPORT VideoEncodeAcceleratorSupportedProfile struct GPU_EXPORT VideoEncodeAcceleratorSupportedProfile {
{
VideoCodecProfile profile; VideoCodecProfile profile;
gfx::Size max_resolution; gfx::Size max_resolution;
uint32_t max_framerate_numerator; uint32_t max_framerate_numerator;
uint32_t max_framerate_denominator; uint32_t max_framerate_denominator;
}; };
using VideoEncodeAcceleratorSupportedProfiles = std::vector<VideoEncodeAcceleratorSupportedProfile>; using VideoEncodeAcceleratorSupportedProfiles =
std::vector<VideoEncodeAcceleratorSupportedProfile>;
struct GPU_EXPORT GPUInfo enum class ImageDecodeAcceleratorType {
{ kJpeg = 0,
struct GPU_EXPORT GPUDevice kUnknown = 1,
{ kMaxValue = kUnknown,
};
enum class ImageDecodeAcceleratorSubsampling {
k420 = 0,
k422 = 1,
kMaxValue = k422,
};
// 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>;
#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 };
GPU_EXPORT const char* OverlayFormatToString(OverlayFormat format);
struct GPU_EXPORT OverlayCapability {
OverlayFormat format;
bool is_scaling_supported;
bool operator==(const OverlayCapability& other) const;
};
using OverlayCapabilities = std::vector<OverlayCapability>;
struct GPU_EXPORT Dx12VulkanVersionInfo {
bool IsEmpty() const { return !d3d12_feature_level && !vulkan_version; }
// True if the GPU driver supports DX12.
bool supports_dx12 = false;
// True if the GPU driver supports Vulkan.
bool supports_vulkan = false;
// The supported d3d feature level in the gpu driver;
uint32_t d3d12_feature_level = 0;
// The support Vulkan API version in the gpu driver;
uint32_t vulkan_version = 0;
};
#endif
struct GPU_EXPORT GPUInfo {
struct GPU_EXPORT GPUDevice {
GPUDevice(); 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. // The DWORD (uint32_t) representing the graphics card vendor id.
uint32_t vendor_id; uint32_t vendor_id;
...@@ -122,12 +205,26 @@ struct GPU_EXPORT GPUInfo ...@@ -122,12 +205,26 @@ struct GPU_EXPORT GPUInfo
// In Android, these are respectively GL_VENDOR and GL_RENDERER. // In Android, these are respectively GL_VENDOR and GL_RENDERER.
std::string vendor_string; std::string vendor_string;
std::string device_string; std::string device_string;
std::string driver_vendor;
std::string driver_version;
std::string driver_date;
// 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();
GPUInfo(const GPUInfo &other); GPUInfo(const GPUInfo& other);
~GPUInfo(); ~GPUInfo();
// The currently active gpu.
GPUDevice& active_gpu();
const GPUDevice& active_gpu() const;
bool IsInitialized() const;
// The amount of time taken to get from the process starting to the message // The amount of time taken to get from the process starting to the message
// loop being pumped. // loop being pumped.
base::TimeDelta initialization_time; base::TimeDelta initialization_time;
...@@ -144,18 +241,6 @@ struct GPU_EXPORT GPUInfo ...@@ -144,18 +241,6 @@ struct GPU_EXPORT GPUInfo
// Secondary GPUs, for example, the integrated GPU in a dual GPU machine. // Secondary GPUs, for example, the integrated GPU in a dual GPU machine.
std::vector<GPUDevice> secondary_gpus; std::vector<GPUDevice> secondary_gpus;
// The currently active gpu.
const GPUDevice &active_gpu() const;
// 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. // The version of the pixel/fragment shader used by the gpu.
std::string pixel_shader_version; std::string pixel_shader_version;
...@@ -212,43 +297,47 @@ struct GPU_EXPORT GPUInfo ...@@ -212,43 +297,47 @@ struct GPU_EXPORT GPUInfo
// Whether the gpu process is running in a sandbox. // Whether the gpu process is running in a sandbox.
bool sandboxed; bool sandboxed;
// Number of GPU process crashes recorded.
int process_crash_count;
// True if the GPU is running in the browser process instead of its own. // True if the GPU is running in the browser process instead of its own.
bool in_process_gpu; bool in_process_gpu;
// True if the GPU process is using the passthrough command decoder. // True if the GPU process is using the passthrough command decoder.
bool passthrough_cmd_decoder; bool passthrough_cmd_decoder;
// True if the current set of outputs supports overlays.
bool supports_overlays = false;
// True only on android when extensions for threaded mailbox sharing are // True only on android when extensions for threaded mailbox sharing are
// present. Threaded mailbox sharing is used on Android only, so this check // present. Threaded mailbox sharing is used on Android only, so this check
// is only implemented on Android. // is only implemented on Android.
bool can_support_threaded_texture_mailbox = false; 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) #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. // The information returned by the DirectX Diagnostics Tool.
DxDiagNode dx_diagnostics; DxDiagNode dx_diagnostics;
Dx12VulkanVersionInfo dx12_vulkan_version_info;
#endif #endif
VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities; VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities;
VideoEncodeAcceleratorSupportedProfiles video_encode_accelerator_supported_profiles; VideoEncodeAcceleratorSupportedProfiles
video_encode_accelerator_supported_profiles;
bool jpeg_decode_accelerator_supported; bool jpeg_decode_accelerator_supported;
ImageDecodeAcceleratorSupportedProfiles
image_decode_accelerator_supported_profiles;
#if defined(USE_X11) #if defined(USE_X11)
VisualID system_visual; VisualID system_visual;
VisualID rgba_visual; VisualID rgba_visual;
#endif #endif
bool oop_rasterization_supported;
// Note: when adding new members, please remember to update EnumerateFields // Note: when adding new members, please remember to update EnumerateFields
// in gpu_info.cc. // in gpu_info.cc.
...@@ -256,18 +345,18 @@ struct GPU_EXPORT GPUInfo ...@@ -256,18 +345,18 @@ struct GPU_EXPORT GPUInfo
// enumerate the values in this structure without having to embed // enumerate the values in this structure without having to embed
// references to its specific member variables. This simplifies the // references to its specific member variables. This simplifies the
// addition of new fields to this type. // addition of new fields to this type.
class Enumerator class Enumerator {
{
public: public:
// The following methods apply to the "current" object. Initially this // The following methods apply to the "current" object. Initially this
// is the root object, but calls to BeginGPUDevice/EndGPUDevice and // is the root object, but calls to BeginGPUDevice/EndGPUDevice and
// BeginAuxAttributes/EndAuxAttributes change the object to which these // BeginAuxAttributes/EndAuxAttributes change the object to which these
// calls should apply. // calls should apply.
virtual void AddInt64(const char *name, int64_t value) = 0; virtual void AddInt64(const char* name, int64_t value) = 0;
virtual void AddInt(const char *name, int value) = 0; virtual void AddInt(const char* name, int value) = 0;
virtual void AddString(const char *name, const std::string &value) = 0; virtual void AddString(const char* name, const std::string& value) = 0;
virtual void AddBool(const char *name, bool value) = 0; virtual void AddBool(const char* name, bool value) = 0;
virtual void AddTimeDeltaInSecondsF(const char *name, const base::TimeDelta &value) = 0; virtual void AddTimeDeltaInSecondsF(const char* name,
const base::TimeDelta& value) = 0;
// Markers indicating that a GPUDevice is being described. // Markers indicating that a GPUDevice is being described.
virtual void BeginGPUDevice() = 0; virtual void BeginGPUDevice() = 0;
...@@ -283,17 +372,28 @@ struct GPU_EXPORT GPUInfo ...@@ -283,17 +372,28 @@ struct GPU_EXPORT GPUInfo
virtual void BeginVideoEncodeAcceleratorSupportedProfile() = 0; virtual void BeginVideoEncodeAcceleratorSupportedProfile() = 0;
virtual void EndVideoEncodeAcceleratorSupportedProfile() = 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 // Markers indicating that "auxiliary" attributes of the GPUInfo
// (according to the DevTools protocol) are being described. // (according to the DevTools protocol) are being described.
virtual void BeginAuxAttributes() = 0; virtual void BeginAuxAttributes() = 0;
virtual void EndAuxAttributes() = 0; virtual void EndAuxAttributes() = 0;
virtual void BeginOverlayCapability() = 0;
virtual void EndOverlayCapability() = 0;
virtual void BeginDx12VulkanVersionInfo() = 0;
virtual void EndDx12VulkanVersionInfo() = 0;
protected: protected:
virtual ~Enumerator() {} virtual ~Enumerator() = default;
}; };
// Outputs the fields in this structure to the provided enumerator. // Outputs the fields in this structure to the provided enumerator.
void EnumerateFields(Enumerator *enumerator) const; void EnumerateFields(Enumerator* enumerator) const;
}; };
} // namespace gpu } // namespace gpu
......
...@@ -99,32 +99,36 @@ GPUTestConfig::OS GetCurrentOS() { ...@@ -99,32 +99,36 @@ GPUTestConfig::OS GetCurrentOS() {
return GPUTestConfig::kOsMacSierra; return GPUTestConfig::kOsMacSierra;
case 13: case 13:
return GPUTestConfig::kOsMacHighSierra; return GPUTestConfig::kOsMacHighSierra;
case 14:
return GPUTestConfig::kOsMacMojave;
} }
} }
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
return GPUTestConfig::kOsAndroid; return GPUTestConfig::kOsAndroid;
#elif defined(OS_FUCHSIA)
return GPUTestConfig::kOsFuchsia;
#endif #endif
return GPUTestConfig::kOsUnknown; return GPUTestConfig::kOsUnknown;
} }
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) { bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
angle::SystemInfo info; angle::SystemInfo info;
if (!angle::GetSystemInfo(&info)) { if (!angle::GetSystemInfo(&info)) {
return kCollectInfoFatalFailure; return false;
} }
const angle::GPUDeviceInfo& gpu = info.gpus[info.primaryGPUIndex]; const angle::GPUDeviceInfo& gpu = info.gpus[info.primaryGPUIndex];
gpu_info->gpu.vendor_id = gpu.vendorId; gpu_info->gpu.vendor_id = gpu.vendorId;
gpu_info->gpu.device_id = gpu.deviceId; gpu_info->gpu.device_id = gpu.deviceId;
gpu_info->gpu.active = true; gpu_info->gpu.active = true;
return kCollectInfoSuccess; return true;
} }
#else #else
CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) { bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
gpu_info->gpu.vendor_id = 0; gpu_info->gpu.vendor_id = 0;
gpu_info->gpu.device_id = 0; gpu_info->gpu.device_id = 0;
gpu_info->gpu.active = true; gpu_info->gpu.active = true;
return kCollectInfoNonFatalFailure; return false;
} }
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
} // namespace anonymous } // namespace anonymous
...@@ -138,11 +142,11 @@ GPUTestConfig::GPUTestConfig() ...@@ -138,11 +142,11 @@ GPUTestConfig::GPUTestConfig()
GPUTestConfig::GPUTestConfig(const GPUTestConfig& other) = default; GPUTestConfig::GPUTestConfig(const GPUTestConfig& other) = default;
GPUTestConfig::~GPUTestConfig() { GPUTestConfig::~GPUTestConfig() = default;
}
void GPUTestConfig::set_os(int32_t os) { 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; os_ = os;
} }
...@@ -214,8 +218,7 @@ void GPUTestConfig::ClearGPUVendor() { ...@@ -214,8 +218,7 @@ void GPUTestConfig::ClearGPUVendor() {
gpu_vendor_.clear(); gpu_vendor_.clear();
} }
GPUTestBotConfig::~GPUTestBotConfig() { GPUTestBotConfig::~GPUTestBotConfig() = default;
}
void GPUTestBotConfig::AddGPUVendor(uint32_t gpu_vendor) { void GPUTestBotConfig::AddGPUVendor(uint32_t gpu_vendor) {
DCHECK_EQ(0u, GPUTestConfig::gpu_vendor().size()); DCHECK_EQ(0u, GPUTestConfig::gpu_vendor().size());
...@@ -248,9 +251,11 @@ bool GPUTestBotConfig::IsValid() const { ...@@ -248,9 +251,11 @@ bool GPUTestBotConfig::IsValid() const {
case kOsMacElCapitan: case kOsMacElCapitan:
case kOsMacSierra: case kOsMacSierra:
case kOsMacHighSierra: case kOsMacHighSierra:
case kOsMacMojave:
case kOsLinux: case kOsLinux:
case kOsChromeOS: case kOsChromeOS:
case kOsAndroid: case kOsAndroid:
case kOsFuchsia:
break; break;
default: default:
return false; return false;
...@@ -309,10 +314,9 @@ bool GPUTestBotConfig::Matches(const std::string& config_data) const { ...@@ -309,10 +314,9 @@ bool GPUTestBotConfig::Matches(const std::string& config_data) const {
bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo* gpu_info) { bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo* gpu_info) {
bool rt; bool rt;
if (gpu_info == NULL) { if (!gpu_info) {
GPUInfo my_gpu_info; GPUInfo my_gpu_info;
CollectInfoResult result = CollectBasicGraphicsInfo(&my_gpu_info); if (!CollectBasicGraphicsInfo(&my_gpu_info)) {
if (result != kCollectInfoSuccess) {
LOG(ERROR) << "Fail to identify GPU\n"; LOG(ERROR) << "Fail to identify GPU\n";
DisableGPUInfoValidation(); DisableGPUInfoValidation();
rt = true; rt = true;
...@@ -338,7 +342,7 @@ bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo* gpu_info) { ...@@ -338,7 +342,7 @@ bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo* gpu_info) {
// static // static
bool GPUTestBotConfig::CurrentConfigMatches(const std::string& config_data) { bool GPUTestBotConfig::CurrentConfigMatches(const std::string& config_data) {
GPUTestBotConfig my_config; GPUTestBotConfig my_config;
if (!my_config.LoadCurrentConfig(NULL)) if (!my_config.LoadCurrentConfig(nullptr))
return false; return false;
return my_config.Matches(config_data); return my_config.Matches(config_data);
} }
...@@ -347,7 +351,7 @@ bool GPUTestBotConfig::CurrentConfigMatches(const std::string& config_data) { ...@@ -347,7 +351,7 @@ bool GPUTestBotConfig::CurrentConfigMatches(const std::string& config_data) {
bool GPUTestBotConfig::CurrentConfigMatches( bool GPUTestBotConfig::CurrentConfigMatches(
const std::vector<std::string>& configs) { const std::vector<std::string>& configs) {
GPUTestBotConfig my_config; GPUTestBotConfig my_config;
if (!my_config.LoadCurrentConfig(NULL)) if (!my_config.LoadCurrentConfig(nullptr))
return false; return false;
for (size_t i = 0 ; i < configs.size(); ++i) { for (size_t i = 0 ; i < configs.size(); ++i) {
if (my_config.Matches(configs[i])) if (my_config.Matches(configs[i]))
...@@ -362,4 +366,3 @@ bool GPUTestBotConfig::GpuBlacklistedOnBot() { ...@@ -362,4 +366,3 @@ bool GPUTestBotConfig::GpuBlacklistedOnBot() {
} }
} // namespace gpu } // namespace gpu
...@@ -12,16 +12,13 @@ ...@@ -12,16 +12,13 @@
#include "angle_config.h" #include "angle_config.h"
namespace gpu namespace gpu {
{
struct GPUInfo; struct GPUInfo;
class GPU_EXPORT GPUTestConfig class GPU_EXPORT GPUTestConfig {
{
public: public:
enum OS enum OS {
{
kOsUnknown = 0, kOsUnknown = 0,
kOsWinXP = 1 << 0, kOsWinXP = 1 << 0,
kOsWinVista = 1 << 1, kOsWinVista = 1 << 1,
...@@ -36,25 +33,25 @@ class GPU_EXPORT GPUTestConfig ...@@ -36,25 +33,25 @@ class GPU_EXPORT GPUTestConfig
kOsMacElCapitan = 1 << 10, kOsMacElCapitan = 1 << 10,
kOsMacSierra = 1 << 11, kOsMacSierra = 1 << 11,
kOsMacHighSierra = 1 << 12, kOsMacHighSierra = 1 << 12,
kOsMac = kOsMacLeopard | kOsMacSnowLeopard | kOsMacLion | kOsMacMountainLion | kOsMacMojave = 1 << 13,
kOsMacMavericks | kOsMacYosemite | kOsMacElCapitan | kOsMacSierra | kOsMac = kOsMacLeopard | kOsMacSnowLeopard | kOsMacLion |
kOsMacHighSierra, kOsMacMountainLion | kOsMacMavericks | kOsMacYosemite |
kOsLinux = 1 << 13, kOsMacElCapitan | kOsMacSierra | kOsMacHighSierra | kOsMacMojave,
kOsChromeOS = 1 << 14, kOsLinux = 1 << 14,
kOsAndroid = 1 << 15, kOsChromeOS = 1 << 15,
kOsWin10 = 1 << 16, kOsAndroid = 1 << 16,
kOsWin10 = 1 << 17,
kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8 | kOsWin10, kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8 | kOsWin10,
kOsFuchsia = 1 << 18,
}; };
enum BuildType enum BuildType {
{
kBuildTypeUnknown = 0, kBuildTypeUnknown = 0,
kBuildTypeRelease = 1 << 0, kBuildTypeRelease = 1 << 0,
kBuildTypeDebug = 1 << 1, kBuildTypeDebug = 1 << 1,
}; };
enum API enum API {
{
kAPIUnknown = 0, kAPIUnknown = 0,
kAPID3D9 = 1 << 0, kAPID3D9 = 1 << 0,
kAPID3D11 = 1 << 1, kAPID3D11 = 1 << 1,
...@@ -64,7 +61,7 @@ class GPU_EXPORT GPUTestConfig ...@@ -64,7 +61,7 @@ class GPU_EXPORT GPUTestConfig
}; };
GPUTestConfig(); GPUTestConfig();
GPUTestConfig(const GPUTestConfig &other); GPUTestConfig(const GPUTestConfig& other);
virtual ~GPUTestConfig(); virtual ~GPUTestConfig();
void set_os(int32_t os); void set_os(int32_t os);
...@@ -75,7 +72,7 @@ class GPU_EXPORT GPUTestConfig ...@@ -75,7 +72,7 @@ class GPU_EXPORT GPUTestConfig
virtual void AddGPUVendor(uint32_t gpu_vendor); virtual void AddGPUVendor(uint32_t gpu_vendor);
int32_t os() const { return os_; } int32_t os() const { return os_; }
const std::vector<uint32_t> &gpu_vendor() const { return gpu_vendor_; } const std::vector<uint32_t>& gpu_vendor() const { return gpu_vendor_; }
uint32_t gpu_device_id() const { return gpu_device_id_; } uint32_t gpu_device_id() const { return gpu_device_id_; }
int32_t build_type() const { return build_type_; } int32_t build_type() const { return build_type_; }
int32_t api() const { return api_; } int32_t api() const { return api_; }
...@@ -86,7 +83,7 @@ class GPU_EXPORT GPUTestConfig ...@@ -86,7 +83,7 @@ class GPU_EXPORT GPUTestConfig
// Check if two configs overlap, i.e., if there exists a config that matches // Check if two configs overlap, i.e., if there exists a config that matches
// both configs. // both configs.
bool OverlapsWith(const GPUTestConfig &config) const; bool OverlapsWith(const GPUTestConfig& config) const;
// Disable validation of GPU vendor and device ids. // Disable validation of GPU vendor and device ids.
void DisableGPUInfoValidation(); void DisableGPUInfoValidation();
...@@ -115,17 +112,16 @@ class GPU_EXPORT GPUTestConfig ...@@ -115,17 +112,16 @@ class GPU_EXPORT GPUTestConfig
int32_t api_; int32_t api_;
}; };
class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig {
{
public: public:
GPUTestBotConfig() {} GPUTestBotConfig() = default;
~GPUTestBotConfig() override; ~GPUTestBotConfig() override;
// This should only be called when no gpu_vendor is added. // This should only be called when no gpu_vendor is added.
void AddGPUVendor(uint32_t gpu_vendor) override; void AddGPUVendor(uint32_t gpu_vendor) override;
// Return false if gpu_info does not have valid vendor_id and device_id. // Return false if gpu_info does not have valid vendor_id and device_id.
bool SetGPUInfo(const GPUInfo &gpu_info); bool SetGPUInfo(const GPUInfo& gpu_info);
// Check if the bot config is valid, i.e., if it is one valid test-bot // 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 // environment. For example, if a field is unknown, or if OS is not one
...@@ -134,16 +130,16 @@ class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig ...@@ -134,16 +130,16 @@ class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig
// Check if a bot config matches a test config, i.e., the test config is a // Check if a bot config matches a test config, i.e., the test config is a
// superset of the bot config. // superset of the bot config.
bool Matches(const GPUTestConfig &config) const; bool Matches(const GPUTestConfig& config) const;
bool Matches(const std::string &config_data) const; bool Matches(const std::string& config_data) const;
// Setup the config with the current gpu testing environment. // Setup the config with the current gpu testing environment.
// If gpu_info is NULL, collect GPUInfo first. // If gpu_info is nullptr, collect GPUInfo first.
bool LoadCurrentConfig(const GPUInfo *gpu_info); bool LoadCurrentConfig(const GPUInfo* gpu_info);
// Check if this bot's config matches |config_data| or any of the |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::string& config_data);
static bool CurrentConfigMatches(const std::vector<std::string> &configs); static bool CurrentConfigMatches(const std::vector<std::string>& configs);
// Check if the bot has blacklisted all GPU features. // Check if the bot has blacklisted all GPU features.
static bool GpuBlacklistedOnBot(); static bool GpuBlacklistedOnBot();
...@@ -152,3 +148,4 @@ class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig ...@@ -152,3 +148,4 @@ class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig
} // namespace gpu } // namespace gpu
#endif // ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_ #endif // ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_
...@@ -75,6 +75,7 @@ enum Token { ...@@ -75,6 +75,7 @@ enum Token {
kConfigMacElCapitan, kConfigMacElCapitan,
kConfigMacSierra, kConfigMacSierra,
kConfigMacHighSierra, kConfigMacHighSierra,
kConfigMacMojave,
kConfigMac, kConfigMac,
kConfigLinux, kConfigLinux,
kConfigChromeOS, kConfigChromeOS,
...@@ -132,6 +133,7 @@ const TokenInfo kTokenData[] = { ...@@ -132,6 +133,7 @@ const TokenInfo kTokenData[] = {
{"elcapitan", GPUTestConfig::kOsMacElCapitan}, {"elcapitan", GPUTestConfig::kOsMacElCapitan},
{"sierra", GPUTestConfig::kOsMacSierra}, {"sierra", GPUTestConfig::kOsMacSierra},
{"highsierra", GPUTestConfig::kOsMacHighSierra}, {"highsierra", GPUTestConfig::kOsMacHighSierra},
{"mojave", GPUTestConfig::kOsMacMojave},
{"mac", GPUTestConfig::kOsMac}, {"mac", GPUTestConfig::kOsMac},
{"linux", GPUTestConfig::kOsLinux}, {"linux", GPUTestConfig::kOsLinux},
{"chromeos", GPUTestConfig::kOsChromeOS}, {"chromeos", GPUTestConfig::kOsChromeOS},
...@@ -221,8 +223,7 @@ GPUTestExpectationsParser::GPUTestExpectationsParser() { ...@@ -221,8 +223,7 @@ GPUTestExpectationsParser::GPUTestExpectationsParser() {
sizeof(kErrorMessage) / sizeof(kErrorMessage[0])); sizeof(kErrorMessage) / sizeof(kErrorMessage[0]));
} }
GPUTestExpectationsParser::~GPUTestExpectationsParser() { GPUTestExpectationsParser::~GPUTestExpectationsParser() = default;
}
bool GPUTestExpectationsParser::LoadTestExpectations(const std::string& data) { bool GPUTestExpectationsParser::LoadTestExpectations(const std::string& data) {
entries_.clear(); entries_.clear();
...@@ -297,6 +298,7 @@ bool GPUTestExpectationsParser::ParseConfig( ...@@ -297,6 +298,7 @@ bool GPUTestExpectationsParser::ParseConfig(
case kConfigMacElCapitan: case kConfigMacElCapitan:
case kConfigMacSierra: case kConfigMacSierra:
case kConfigMacHighSierra: case kConfigMacHighSierra:
case kConfigMacMojave:
case kConfigMac: case kConfigMac:
case kConfigLinux: case kConfigLinux:
case kConfigChromeOS: case kConfigChromeOS:
...@@ -359,6 +361,7 @@ bool GPUTestExpectationsParser::ParseLine( ...@@ -359,6 +361,7 @@ bool GPUTestExpectationsParser::ParseLine(
case kConfigMacElCapitan: case kConfigMacElCapitan:
case kConfigMacSierra: case kConfigMacSierra:
case kConfigMacHighSierra: case kConfigMacHighSierra:
case kConfigMacMojave:
case kConfigMac: case kConfigMac:
case kConfigLinux: case kConfigLinux:
case kConfigChromeOS: case kConfigChromeOS:
...@@ -484,6 +487,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig* config, ...@@ -484,6 +487,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig* config,
case kConfigMacElCapitan: case kConfigMacElCapitan:
case kConfigMacSierra: case kConfigMacSierra:
case kConfigMacHighSierra: case kConfigMacHighSierra:
case kConfigMacMojave:
case kConfigMac: case kConfigMac:
case kConfigLinux: case kConfigLinux:
case kConfigChromeOS: case kConfigChromeOS:
......
...@@ -14,14 +14,11 @@ ...@@ -14,14 +14,11 @@
#include "angle_config.h" #include "angle_config.h"
#include "gpu_test_config.h" #include "gpu_test_config.h"
namespace gpu namespace gpu {
{
class GPU_EXPORT GPUTestExpectationsParser class GPU_EXPORT GPUTestExpectationsParser {
{
public: public:
enum GPUTestExpectation enum GPUTestExpectation {
{
kGpuTestPass = 1 << 0, kGpuTestPass = 1 << 0,
kGpuTestFail = 1 << 1, kGpuTestFail = 1 << 1,
kGpuTestFlaky = 1 << 2, kGpuTestFlaky = 1 << 2,
...@@ -35,23 +32,22 @@ class GPU_EXPORT GPUTestExpectationsParser ...@@ -35,23 +32,22 @@ class GPU_EXPORT GPUTestExpectationsParser
// Parse the text expectations, and if no error is encountered, // Parse the text expectations, and if no error is encountered,
// save all the entries. Otherwise, generate error messages. // save all the entries. Otherwise, generate error messages.
// Return true if parsing succeeds. // Return true if parsing succeeds.
bool LoadTestExpectations(const std::string &data); bool LoadTestExpectations(const std::string& data);
bool LoadTestExpectationsFromFile(const std::string &path); bool LoadTestExpectationsFromFile(const std::string& path);
// Query error messages from the last LoadTestExpectations() call. // Query error messages from the last LoadTestExpectations() call.
const std::vector<std::string> &GetErrorMessages() const; const std::vector<std::string>& GetErrorMessages() const;
// Get the test expectation of a given test on a given bot. // Get the test expectation of a given test on a given bot.
int32_t GetTestExpectation(const std::string &test_name, int32_t GetTestExpectation(const std::string& test_name,
const GPUTestBotConfig &bot_config) const; const GPUTestBotConfig& bot_config) const;
// Parse a list of config modifiers. If we have a valid entry with no // Parse a list of config modifiers. If we have a valid entry with no
// conflicts, | config | stores it, and the function returns true. // conflicts, | config | stores it, and the function returns true.
bool ParseConfig(const std::string &config_data, GPUTestConfig *config); bool ParseConfig(const std::string& config_data, GPUTestConfig* config);
private: private:
struct GPUTestExpectationEntry struct GPUTestExpectationEntry {
{
GPUTestExpectationEntry(); GPUTestExpectationEntry();
std::string test_name; std::string test_name;
...@@ -62,14 +58,16 @@ class GPU_EXPORT GPUTestExpectationsParser ...@@ -62,14 +58,16 @@ class GPU_EXPORT GPUTestExpectationsParser
// Parse a line of text. If we have a valid entry, save it; otherwise, // Parse a line of text. If we have a valid entry, save it; otherwise,
// generate error messages. // generate error messages.
bool ParseLine(const std::string &line_data, size_t line_number); bool ParseLine(const std::string& line_data, size_t line_number);
// Update OS/GPUVendor/BuildType modifiers. May generate an error message. // Update OS/GPUVendor/BuildType modifiers. May generate an error message.
bool UpdateTestConfig(GPUTestConfig *config, int32_t token, size_t line_number); bool UpdateTestConfig(GPUTestConfig* config,
int32_t token,
size_t line_number);
// Update GPUDeviceID modifier. May generate an error message. // Update GPUDeviceID modifier. May generate an error message.
bool UpdateTestConfig(GPUTestConfig *config, bool UpdateTestConfig(GPUTestConfig* config,
const std::string &gpu_device_id, const std::string & gpu_device_id,
size_t line_number); size_t line_number);
// Check if two entries' config overlap with each other. May generate an // Check if two entries' config overlap with each other. May generate an
...@@ -77,8 +75,8 @@ class GPU_EXPORT GPUTestExpectationsParser ...@@ -77,8 +75,8 @@ class GPU_EXPORT GPUTestExpectationsParser
bool DetectConflictsBetweenEntries(); bool DetectConflictsBetweenEntries();
// Save an error message, which can be queried later. // 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 line_number);
void PushErrorMessage(const std::string &message, void PushErrorMessage(const std::string& message,
size_t entry1_line_number, size_t entry1_line_number,
size_t entry2_line_number); size_t entry2_line_number);
...@@ -89,3 +87,4 @@ class GPU_EXPORT GPUTestExpectationsParser ...@@ -89,3 +87,4 @@ class GPU_EXPORT GPUTestExpectationsParser
} // namespace gpu } // namespace gpu
#endif // ANGLE_GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_ #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