Only default ANGLE to swiftshader if envvar empty.

Only set SwiftShader as the default ANGLE backend if the
ANGLE_DEFAULT_PLATFORM environment var is empty. This will allow
devs to set it.

Bug: dawn:447
Change-Id: I49aac4bcb4b0b7c56903eca68248ee22cdf1e6f2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/41140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White 2021-02-08 21:30:44 +00:00 committed by Commit Bot service account
parent 58a471ae25
commit e7e42ebbed
1 changed files with 3 additions and 1 deletions

View File

@ -381,7 +381,9 @@ std::unique_ptr<dawn_native::Instance> DawnTestEnvironment::CreateInstanceAndDis
adapterOptions.getProc = reinterpret_cast<void* (*)(const char*)>(glfwGetProcAddress);
instance->DiscoverAdapters(&adapterOptions);
SetEnvironmentVar("ANGLE_DEFAULT_PLATFORM", "swiftshader");
if (GetEnvironmentVar("ANGLE_DEFAULT_PLATFORM").empty()) {
SetEnvironmentVar("ANGLE_DEFAULT_PLATFORM", "swiftshader");
}
glfwDefaultWindowHints();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);