mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-16 12:21:35 +00:00
Implement a --use-angle= argument in DawnTest.
This will allow the bots to specify a particular backend. Change-Id: I9486019c3aef3f8aafb79e30dfc62d23ae9eefac Bug: dawn:1420 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90320 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
parent
8556ae0061
commit
cc8cc9c67b
@ -313,6 +313,13 @@ void DawnTestEnvironment::ParseArgs(int argc, char** argv) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr const char kUseAngleArg[] = "--use-angle=";
|
||||||
|
argLen = sizeof(kUseAngleArg) - 1;
|
||||||
|
if (strncmp(argv[i], kUseAngleArg, argLen) == 0) {
|
||||||
|
mANGLEBackend = argv[i] + argLen;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
constexpr const char kExclusiveDeviceTypePreferenceArg[] =
|
constexpr const char kExclusiveDeviceTypePreferenceArg[] =
|
||||||
"--exclusive-device-type-preference=";
|
"--exclusive-device-type-preference=";
|
||||||
argLen = sizeof(kExclusiveDeviceTypePreferenceArg) - 1;
|
argLen = sizeof(kExclusiveDeviceTypePreferenceArg) - 1;
|
||||||
@ -440,7 +447,13 @@ std::unique_ptr<dawn::native::Instance> DawnTestEnvironment::CreateInstanceAndDi
|
|||||||
|
|
||||||
ScopedEnvironmentVar angleDefaultPlatform;
|
ScopedEnvironmentVar angleDefaultPlatform;
|
||||||
if (GetEnvironmentVar("ANGLE_DEFAULT_PLATFORM").first.empty()) {
|
if (GetEnvironmentVar("ANGLE_DEFAULT_PLATFORM").first.empty()) {
|
||||||
angleDefaultPlatform.Set("ANGLE_DEFAULT_PLATFORM", "swiftshader");
|
const char* platform;
|
||||||
|
if (!mANGLEBackend.empty()) {
|
||||||
|
platform = mANGLEBackend.c_str();
|
||||||
|
} else {
|
||||||
|
platform = "swiftshader";
|
||||||
|
}
|
||||||
|
angleDefaultPlatform.Set("ANGLE_DEFAULT_PLATFORM", platform);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!glfwInit()) {
|
if (!glfwInit()) {
|
||||||
|
@ -257,6 +257,7 @@ class DawnTestEnvironment : public testing::Environment {
|
|||||||
bool mUseWire = false;
|
bool mUseWire = false;
|
||||||
dawn::native::BackendValidationLevel mBackendValidationLevel =
|
dawn::native::BackendValidationLevel mBackendValidationLevel =
|
||||||
dawn::native::BackendValidationLevel::Disabled;
|
dawn::native::BackendValidationLevel::Disabled;
|
||||||
|
std::string mANGLEBackend;
|
||||||
bool mBeginCaptureOnStartup = false;
|
bool mBeginCaptureOnStartup = false;
|
||||||
bool mHasVendorIdFilter = false;
|
bool mHasVendorIdFilter = false;
|
||||||
uint32_t mVendorIdFilter = 0;
|
uint32_t mVendorIdFilter = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user