Commit 92ba46ba authored by Antonio Maiorano's avatar Antonio Maiorano Committed by Commit Bot

Fix "is_swiftshader" feature flag not being set when used via ANGLE

is_swiftshader should be set to true if Chrome is launched with
"--use_gl=swiftshader" or "--use_gl=angle --use_angle=swiftshader".

Bug: b/146423360
Change-Id: I99a510bc92ecabdf5ef6a4954df8c251d83b674b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2186996Reviewed-by: default avatarGeoff Lang <geofflang@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Cr-Commit-Position: refs/heads/master@{#766502}
parent 62a967ad
...@@ -244,13 +244,16 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) { ...@@ -244,13 +244,16 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) {
feature_flags_.enable_shader_name_hashing = feature_flags_.enable_shader_name_hashing =
!command_line->HasSwitch(switches::kDisableShaderNameHashing); !command_line->HasSwitch(switches::kDisableShaderNameHashing);
const auto useGL = command_line->GetSwitchValueASCII(switches::kUseGL);
const auto useANGLE = command_line->GetSwitchValueASCII(switches::kUseANGLE);
feature_flags_.is_swiftshader_for_webgl = feature_flags_.is_swiftshader_for_webgl =
(command_line->GetSwitchValueASCII(switches::kUseGL) == (useGL == gl::kGLImplementationSwiftShaderForWebGLName);
gl::kGLImplementationSwiftShaderForWebGLName);
feature_flags_.is_swiftshader = feature_flags_.is_swiftshader =
(command_line->GetSwitchValueASCII(switches::kUseGL) == (useGL == gl::kGLImplementationSwiftShaderName) ||
gl::kGLImplementationSwiftShaderName); ((useGL == gl::kGLImplementationANGLEName) &&
(useANGLE == gl::kANGLEImplementationSwiftShaderName));
// The shader translator is needed to translate from WebGL-conformant GLES SL // The shader translator is needed to translate from WebGL-conformant GLES SL
// to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to // to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to
......
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