Commit beb4e81f authored by Yuly Novikov's avatar Yuly Novikov Committed by Commit Bot

Fake GPU info collection on SwANGLE

Similarly to SwiftShader, use fake GPU Vendor and Device IDs
when running on top of SwANGLE to prevent blacklisting.
This allows running WebGL tests on top of SwANGLE on GPU-less GCEs.

Bug: 1064477
Change-Id: I0748d46e36e4749c05f1a52ff557173160089b50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2159796
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762137}
parent cc4e10f7
......@@ -160,6 +160,8 @@ namespace gpu {
bool CollectBasicGraphicsInfo(const base::CommandLine* command_line,
GPUInfo* gpu_info) {
std::string use_gl = command_line->GetSwitchValueASCII(switches::kUseGL);
std::string use_angle =
command_line->GetSwitchValueASCII(switches::kUseANGLE);
// If GL is disabled then we don't need GPUInfo.
if (use_gl == gl::kGLImplementationDisabledName) {
......@@ -187,6 +189,19 @@ bool CollectBasicGraphicsInfo(const base::CommandLine* command_line,
// blacklist rules.
gpu_info->gpu.driver_vendor = software_gl_impl_name.as_string();
return true;
} else if (use_gl == gl::kGLImplementationANGLEName &&
use_angle == gl::kANGLEImplementationSwiftShaderName) {
// Similarly to the above, use fake vendor and device ids
// to make sure they never gets blacklisted for SwANGLE as well.
gpu_info->gpu.vendor_id = 0xffff;
gpu_info->gpu.device_id = 0xffff;
// Also declare the driver_vendor to be <SwANGLE> to be able to
// specify exceptions based on driver_vendor==<SwANGLE> for some
// blacklist rules.
gpu_info->gpu.driver_vendor = "SwANGLE";
return true;
}
......
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