Commit 519a5be2 by Jamie Madill

Update ANGLE's GPU test expectations code.

Pull over the more recent changes from Chromium which include the graphics API, which we can use for specific API suppressions for the dEQP tests. Also update the docs with detailed steps for updating from Chrome. BUG=None Change-Id: I0cb7d8268fbb2778c0160a58f1a10ef4a92c9c61 Reviewed-on: https://chromium-review.googlesource.com/287810Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent b18609b9
......@@ -3,9 +3,20 @@ directory, we want to keep a patch of the changes added to make it compile with
will allow us to merge Chromium changes easily in our ```gpu_test_expectations```.
In order to make a change to this directory, do the following:
- copy the directory somewhere like in ```gpu_test_expectations_reverted```
- in ```gpu_test_expectations_reverted``` run ```patch -p 1 -R angle-mods.patch```
- do your changes in ```gpu_test_expectations```
- delete angle-mods.path in both directories
- run ```diff -rupN gpu_test_expectations_reverted gpu_test_expectations > angle-mods.patch```
- copy ```angle-mods.patch``` in ```gpu_test_expectations```
* copy the directory somewhere like in ```gpu_test_expectations_reverted```
* in ```gpu_test_expectations_reverted``` run ```patch -p 1 -R angle-mods.patch```
* do your changes in ```gpu_test_expectations```
* delete angle-mods.path in both directories
* run ```diff -rupN gpu_test_expectations_reverted gpu_test_expectations > angle-mods.patch```
* copy ```angle-mods.patch``` in ```gpu_test_expectations```
How to update from Chromium:
* ```git apply -R angle-mods.patch```, ```git add . -u```, ```git commit```
* Copy over Chromium files, ```git add . -u```, ```git commit```
* ```git revert HEAD~2```
* ```rm angle-mods.patch```
* ```git diff HEAD~1 (`)ls(`) > angle-mods.patch```,```git add angle-mods.patch```, ```git commit --amend```
* ```git rebase -i``` to squash the three patches into one.
......@@ -184,6 +184,8 @@ GPUTestConfig::OS GetCurrentOS() {
return GPUTestConfig::kOsWin7;
if (major_version == 6 && (minor_version == 2 || minor_version == 3))
return GPUTestConfig::kOsWin8;
if (major_version == 10)
return GPUTestConfig::kOsWin10;
#elif defined(OS_MACOSX)
int32 major_version = 0;
int32 minor_version = 0;
......@@ -218,8 +220,8 @@ GPUTestConfig::GPUTestConfig()
: validate_gpu_info_(true),
os_(kOsUnknown),
gpu_device_id_(0),
build_type_(kBuildTypeUnknown) {
}
build_type_(kBuildTypeUnknown),
api_(kAPIUnknown) {}
GPUTestConfig::~GPUTestConfig() {
}
......@@ -245,6 +247,11 @@ void GPUTestConfig::set_build_type(int32 build_type) {
build_type_ = build_type;
}
void GPUTestConfig::set_api(int32 api) {
DCHECK_EQ(0, api & ~(kAPID3D9 | kAPID3D11 | kAPIGLDesktop | kAPIGLES));
api_ = api;
}
bool GPUTestConfig::IsValid() const {
if (!validate_gpu_info_)
return true;
......@@ -314,6 +321,7 @@ bool GPUTestBotConfig::IsValid() const {
case kOsWinVista:
case kOsWin7:
case kOsWin8:
case kOsWin10:
case kOsMacLeopard:
case kOsMacSnowLeopard:
case kOsMacLion:
......@@ -365,6 +373,8 @@ bool GPUTestBotConfig::Matches(const GPUTestConfig& config) const {
if (config.build_type() != kBuildTypeUnknown &&
(build_type() & config.build_type()) == 0)
return false;
if (config.api() != 0 && (api() & config.api()) == 0)
return false;
return true;
}
......
......@@ -22,7 +22,6 @@ class GPU_EXPORT GPUTestConfig {
kOsWinVista = 1 << 1,
kOsWin7 = 1 << 2,
kOsWin8 = 1 << 3,
kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8,
kOsMacLeopard = 1 << 4,
kOsMacSnowLeopard = 1 << 5,
kOsMacLion = 1 << 6,
......@@ -34,6 +33,8 @@ class GPU_EXPORT GPUTestConfig {
kOsLinux = 1 << 10,
kOsChromeOS = 1 << 11,
kOsAndroid = 1 << 12,
kOsWin10 = 1 << 13,
kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8 | kOsWin10,
};
enum BuildType {
......@@ -42,12 +43,21 @@ class GPU_EXPORT GPUTestConfig {
kBuildTypeDebug = 1 << 1,
};
enum API {
kAPIUnknown = 0,
kAPID3D9 = 1 << 0,
kAPID3D11 = 1 << 1,
kAPIGLDesktop = 1 << 2,
kAPIGLES = 1 << 3,
};
GPUTestConfig();
virtual ~GPUTestConfig();
void set_os(int32 os);
void set_gpu_device_id(uint32 id);
void set_build_type(int32 build_type);
void set_api(int32 api);
virtual void AddGPUVendor(uint32 gpu_vendor);
......@@ -55,6 +65,7 @@ class GPU_EXPORT GPUTestConfig {
const std::vector<uint32>& gpu_vendor() const { return gpu_vendor_; }
uint32 gpu_device_id() const { return gpu_device_id_; }
int32 build_type() const { return build_type_; }
int32 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.
......@@ -86,6 +97,9 @@ class GPU_EXPORT GPUTestConfig {
// Release or Debug.
int32 build_type_;
// Back-end rendering APIs.
int32 api_;
};
class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig {
......
......@@ -52,6 +52,7 @@ enum Token {
kConfigWinVista,
kConfigWin7,
kConfigWin8,
kConfigWin10,
kConfigWin,
kConfigMacLeopard,
kConfigMacSnowLeopard,
......@@ -71,6 +72,11 @@ enum Token {
// build type
kConfigRelease,
kConfigDebug,
// ANGLE renderer
kConfigD3D9,
kConfigD3D11,
kConfigGLDesktop,
kConfigGLES,
// expectation
kExpectationPass,
kExpectationFail,
......@@ -95,34 +101,39 @@ struct TokenInfo {
};
const TokenInfo kTokenData[] = {
{ "xp", GPUTestConfig::kOsWinXP },
{ "vista", GPUTestConfig::kOsWinVista },
{ "win7", GPUTestConfig::kOsWin7 },
{ "win8", GPUTestConfig::kOsWin8 },
{ "win", GPUTestConfig::kOsWin },
{ "leopard", GPUTestConfig::kOsMacLeopard },
{ "snowleopard", GPUTestConfig::kOsMacSnowLeopard },
{ "lion", GPUTestConfig::kOsMacLion },
{ "mountainlion", GPUTestConfig::kOsMacMountainLion },
{ "mavericks", GPUTestConfig::kOsMacMavericks },
{ "yosemite", GPUTestConfig::kOsMacYosemite },
{ "mac", GPUTestConfig::kOsMac },
{ "linux", GPUTestConfig::kOsLinux },
{ "chromeos", GPUTestConfig::kOsChromeOS },
{ "android", GPUTestConfig::kOsAndroid },
{ "nvidia", 0x10DE },
{ "amd", 0x1002 },
{ "intel", 0x8086 },
{ "vmware", 0x15ad },
{ "release", GPUTestConfig::kBuildTypeRelease },
{ "debug", GPUTestConfig::kBuildTypeDebug },
{ "pass", GPUTestExpectationsParser::kGpuTestPass },
{ "fail", GPUTestExpectationsParser::kGpuTestFail },
{ "flaky", GPUTestExpectationsParser::kGpuTestFlaky },
{ "timeout", GPUTestExpectationsParser::kGpuTestTimeout },
{ "skip", GPUTestExpectationsParser::kGpuTestSkip },
{ ":", 0 },
{ "=", 0 },
{"xp", GPUTestConfig::kOsWinXP},
{"vista", GPUTestConfig::kOsWinVista},
{"win7", GPUTestConfig::kOsWin7},
{"win8", GPUTestConfig::kOsWin8},
{"win10", GPUTestConfig::kOsWin10},
{"win", GPUTestConfig::kOsWin},
{"leopard", GPUTestConfig::kOsMacLeopard},
{"snowleopard", GPUTestConfig::kOsMacSnowLeopard},
{"lion", GPUTestConfig::kOsMacLion},
{"mountainlion", GPUTestConfig::kOsMacMountainLion},
{"mavericks", GPUTestConfig::kOsMacMavericks},
{"yosemite", GPUTestConfig::kOsMacYosemite},
{"mac", GPUTestConfig::kOsMac},
{"linux", GPUTestConfig::kOsLinux},
{"chromeos", GPUTestConfig::kOsChromeOS},
{"android", GPUTestConfig::kOsAndroid},
{"nvidia", 0x10DE},
{"amd", 0x1002},
{"intel", 0x8086},
{"vmware", 0x15ad},
{"release", GPUTestConfig::kBuildTypeRelease},
{"debug", GPUTestConfig::kBuildTypeDebug},
{"d3d9", GPUTestConfig::kAPID3D9},
{"d3d11", GPUTestConfig::kAPID3D11},
{"opengl", GPUTestConfig::kAPIGLDesktop},
{"gles", GPUTestConfig::kAPIGLES},
{"pass", GPUTestExpectationsParser::kGpuTestPass},
{"fail", GPUTestExpectationsParser::kGpuTestFail},
{"flaky", GPUTestExpectationsParser::kGpuTestFlaky},
{"timeout", GPUTestExpectationsParser::kGpuTestTimeout},
{"skip", GPUTestExpectationsParser::kGpuTestSkip},
{":", 0},
{"=", 0},
};
enum ErrorType {
......@@ -132,6 +143,7 @@ enum ErrorType {
kErrorEntryWithOsConflicts,
kErrorEntryWithGpuVendorConflicts,
kErrorEntryWithBuildTypeConflicts,
kErrorEntryWithAPIConflicts,
kErrorEntryWithGpuDeviceIdConflicts,
kErrorEntryWithExpectationConflicts,
kErrorEntriesOverlap,
......@@ -140,25 +152,26 @@ enum ErrorType {
};
const char* kErrorMessage[] = {
"file IO failed",
"entry with wrong format",
"entry invalid, likely wrong modifiers combination",
"entry with OS modifier conflicts",
"entry with GPU vendor modifier conflicts",
"entry with GPU build type conflicts",
"entry with GPU device id conflicts or malformat",
"entry with expectation modifier conflicts",
"two entries's configs overlap",
"file IO failed",
"entry with wrong format",
"entry invalid, likely wrong modifiers combination",
"entry with OS modifier conflicts",
"entry with GPU vendor modifier conflicts",
"entry with GPU build type conflicts",
"entry with GPU API conflicts",
"entry with GPU device id conflicts or malformat",
"entry with expectation modifier conflicts",
"two entries' configs overlap",
};
Token ParseToken(const std::string& word) {
if (StartsWithASCII(word, "//", false))
if (base::StartsWithASCII(word, "//", false))
return kTokenComment;
if (StartsWithASCII(word, "0x", false))
if (base::StartsWithASCII(word, "0x", false))
return kConfigGPUDeviceID;
for (int32 i = 0; i < kNumberOfExactMatchTokens; ++i) {
if (LowerCaseEqualsASCII(word, kTokenData[i].name))
if (base::LowerCaseEqualsASCII(word, kTokenData[i].name))
return static_cast<Token>(i);
}
return kTokenWord;
......@@ -252,6 +265,7 @@ bool GPUTestExpectationsParser::ParseConfig(
case kConfigWinVista:
case kConfigWin7:
case kConfigWin8:
case kConfigWin10:
case kConfigWin:
case kConfigMacLeopard:
case kConfigMacSnowLeopard:
......@@ -269,6 +283,10 @@ bool GPUTestExpectationsParser::ParseConfig(
case kConfigVMWare:
case kConfigRelease:
case kConfigDebug:
case kConfigD3D9:
case kConfigD3D11:
case kConfigGLDesktop:
case kConfigGLES:
case kConfigGPUDeviceID:
if (token == kConfigGPUDeviceID) {
if (!UpdateTestConfig(config, tokens[i], 0))
......@@ -304,6 +322,7 @@ bool GPUTestExpectationsParser::ParseLine(
case kConfigWinVista:
case kConfigWin7:
case kConfigWin8:
case kConfigWin10:
case kConfigWin:
case kConfigMacLeopard:
case kConfigMacSnowLeopard:
......@@ -321,6 +340,10 @@ bool GPUTestExpectationsParser::ParseLine(
case kConfigVMWare:
case kConfigRelease:
case kConfigDebug:
case kConfigD3D9:
case kConfigD3D11:
case kConfigGLDesktop:
case kConfigGLES:
case kConfigGPUDeviceID:
// MODIFIERS, could be in any order, need at least one.
if (stage != kLineParserConfigs && stage != kLineParserBugID) {
......@@ -419,6 +442,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(
case kConfigWinVista:
case kConfigWin7:
case kConfigWin8:
case kConfigWin10:
case kConfigWin:
case kConfigMacLeopard:
case kConfigMacSnowLeopard:
......@@ -466,6 +490,17 @@ bool GPUTestExpectationsParser::UpdateTestConfig(
config->set_build_type(
config->build_type() | kTokenData[token].flag);
break;
case kConfigD3D9:
case kConfigD3D11:
case kConfigGLDesktop:
case kConfigGLES:
if ((config->api() & kTokenData[token].flag) != 0) {
PushErrorMessage(kErrorMessage[kErrorEntryWithAPIConflicts],
line_number);
return false;
}
config->set_api(config->api() | kTokenData[token].flag);
break;
default:
UNREACHABLE();
break;
......
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