1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "gpu/config/gpu_util.h"
#include <memory>
#include <vector>
#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "gpu/config/gpu_blacklist.h"
#include "gpu/config/gpu_crash_keys.h"
#include "gpu/config/gpu_driver_bug_list.h"
#include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "gpu/config/gpu_feature_type.h"
#include "gpu/config/gpu_finch_features.h"
#include "gpu/config/gpu_info_collector.h"
#include "gpu/config/gpu_switches.h"
#include "ui/gl/extension_set.h"
#include "ui/gl/gl_switches.h"
#if defined(OS_ANDROID)
#include "base/no_destructor.h"
#include "base/synchronization/lock.h"
#include "ui/gl/init/gl_factory.h"
#endif // OS_ANDROID
namespace gpu {
namespace {
GpuFeatureStatus GetGpuRasterizationFeatureStatus(
const std::set<int>& blacklisted_features,
const base::CommandLine& command_line) {
if (command_line.HasSwitch(switches::kDisableGpuRasterization))
return kGpuFeatureStatusDisabled;
else if (command_line.HasSwitch(switches::kEnableGpuRasterization))
return kGpuFeatureStatusEnabled;
if (blacklisted_features.count(GPU_FEATURE_TYPE_GPU_RASTERIZATION))
return kGpuFeatureStatusBlacklisted;
// Gpu Rasterization on platforms that are not fully enabled is controlled by
// a finch experiment.
if (!base::FeatureList::IsEnabled(features::kDefaultEnableGpuRasterization))
return kGpuFeatureStatusDisabled;
return kGpuFeatureStatusEnabled;
}
GpuFeatureStatus GetWebGLFeatureStatus(
const std::set<int>& blacklisted_features,
bool use_swift_shader) {
if (use_swift_shader)
return kGpuFeatureStatusEnabled;
if (blacklisted_features.count(GPU_FEATURE_TYPE_ACCELERATED_WEBGL))
return kGpuFeatureStatusBlacklisted;
return kGpuFeatureStatusEnabled;
}
GpuFeatureStatus GetWebGL2FeatureStatus(
const std::set<int>& blacklisted_features,
bool use_swift_shader) {
if (use_swift_shader)
return kGpuFeatureStatusEnabled;
if (blacklisted_features.count(GPU_FEATURE_TYPE_ACCELERATED_WEBGL2))
return kGpuFeatureStatusBlacklisted;
return kGpuFeatureStatusEnabled;
}
GpuFeatureStatus Get2DCanvasFeatureStatus(
const std::set<int>& blacklisted_features,
bool use_swift_shader) {
if (use_swift_shader) {
// This is for testing only. Chrome should exercise the GPU accelerated
// path on top of SwiftShader driver.
return kGpuFeatureStatusEnabled;
}
if (blacklisted_features.count(GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS))
return kGpuFeatureStatusSoftware;
return kGpuFeatureStatusEnabled;
}
GpuFeatureStatus GetFlash3DFeatureStatus(
const std::set<int>& blacklisted_features,
bool use_swift_shader) {
if (use_swift_shader) {
// This is for testing only. Chrome should exercise the GPU accelerated
// path on top of SwiftShader driver.
return kGpuFeatureStatusEnabled;
}
if (blacklisted_features.count(GPU_FEATURE_TYPE_FLASH3D))
return kGpuFeatureStatusBlacklisted;
return kGpuFeatureStatusEnabled;
}
GpuFeatureStatus GetFlashStage3DFeatureStatus(
const std::set<int>& blacklisted_features,
bool use_swift_shader) {
if (use_swift_shader) {
// This is for testing only. Chrome should exercise the GPU accelerated
// path on top of SwiftShader driver.
return kGpuFeatureStatusEnabled;
}
if (blacklisted_features.count(GPU_FEATURE_TYPE_FLASH_STAGE3D))
return kGpuFeatureStatusBlacklisted;
return kGpuFeatureStatusEnabled;
}
GpuFeatureStatus GetFlashStage3DBaselineFeatureStatus(
const std::set<int>& blacklisted_features,
bool use_swift_shader) {
if (use_swift_shader) {
// This is for testing only. Chrome should exercise the GPU accelerated
// path on top of SwiftShader driver.
return kGpuFeatureStatusEnabled;
}
if (blacklisted_features.count(GPU_FEATURE_TYPE_FLASH_STAGE3D) ||
blacklisted_features.count(GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE))
return kGpuFeatureStatusBlacklisted;
return kGpuFeatureStatusEnabled;
}
GpuFeatureStatus GetAcceleratedVideoDecodeFeatureStatus(
const std::set<int>& blacklisted_features,
bool use_swift_shader) {
if (use_swift_shader)
return kGpuFeatureStatusDisabled;
if (blacklisted_features.count(GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE))
return kGpuFeatureStatusBlacklisted;
return kGpuFeatureStatusEnabled;
}
GpuFeatureStatus GetGpuCompositingFeatureStatus(
const std::set<int>& blacklisted_features,
bool use_swift_shader) {
if (use_swift_shader) {
// This is for testing only. Chrome should exercise the GPU accelerated
// path on top of SwiftShader driver.
return kGpuFeatureStatusEnabled;
}
if (blacklisted_features.count(GPU_FEATURE_TYPE_GPU_COMPOSITING))
return kGpuFeatureStatusBlacklisted;
return kGpuFeatureStatusEnabled;
}
void AppendWorkaroundsToCommandLine(const GpuFeatureInfo& gpu_feature_info,
base::CommandLine* command_line) {
if (gpu_feature_info.IsWorkaroundEnabled(DISABLE_D3D11)) {
command_line->AppendSwitch(switches::kDisableD3D11);
}
if (gpu_feature_info.IsWorkaroundEnabled(DISABLE_ES3_GL_CONTEXT)) {
command_line->AppendSwitch(switches::kDisableES3GLContext);
}
if (gpu_feature_info.IsWorkaroundEnabled(DISABLE_DIRECT_COMPOSITION)) {
command_line->AppendSwitch(switches::kDisableDirectComposition);
}
}
// Adjust gpu feature status based on enabled gpu driver bug workarounds.
void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) {
if (gpu_feature_info->IsWorkaroundEnabled(DISABLE_D3D11) ||
gpu_feature_info->IsWorkaroundEnabled(DISABLE_ES3_GL_CONTEXT)) {
gpu_feature_info->status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL2] =
kGpuFeatureStatusBlacklisted;
}
}
GPUInfo* g_gpu_info_cache = nullptr;
GpuFeatureInfo* g_gpu_feature_info_cache = nullptr;
} // namespace anonymous
GpuFeatureInfo ComputeGpuFeatureInfoWithHardwareAccelerationDisabled() {
GpuFeatureInfo gpu_feature_info;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] =
kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] =
kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH_STAGE3D] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL2] =
kGpuFeatureStatusSoftware;
#if DCHECK_IS_ON()
for (int ii = 0; ii < NUMBER_OF_GPU_FEATURE_TYPES; ++ii) {
DCHECK_NE(kGpuFeatureStatusUndefined, gpu_feature_info.status_values[ii]);
}
#endif
return gpu_feature_info;
}
GpuFeatureInfo ComputeGpuFeatureInfoWithNoGpu() {
GpuFeatureInfo gpu_feature_info;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] =
kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH_STAGE3D] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL2] =
kGpuFeatureStatusDisabled;
#if DCHECK_IS_ON()
for (int ii = 0; ii < NUMBER_OF_GPU_FEATURE_TYPES; ++ii) {
DCHECK_NE(kGpuFeatureStatusUndefined, gpu_feature_info.status_values[ii]);
}
#endif
return gpu_feature_info;
}
GpuFeatureInfo ComputeGpuFeatureInfoForSwiftShader() {
GpuFeatureInfo gpu_feature_info;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] =
kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] =
kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH_STAGE3D] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL2] =
kGpuFeatureStatusSoftware;
#if DCHECK_IS_ON()
for (int ii = 0; ii < NUMBER_OF_GPU_FEATURE_TYPES; ++ii) {
DCHECK_NE(kGpuFeatureStatusUndefined, gpu_feature_info.status_values[ii]);
}
#endif
return gpu_feature_info;
}
GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info,
bool ignore_gpu_blacklist,
bool disable_gpu_driver_bug_workarounds,
bool log_gpu_control_list_decisions,
base::CommandLine* command_line,
bool* needs_more_info) {
DCHECK(!needs_more_info || !(*needs_more_info));
bool use_swift_shader = false;
bool use_swift_shader_for_webgl = false;
if (command_line->HasSwitch(switches::kUseGL)) {
std::string use_gl = command_line->GetSwitchValueASCII(switches::kUseGL);
if (use_gl == gl::kGLImplementationSwiftShaderName)
use_swift_shader = true;
else if (use_gl == gl::kGLImplementationSwiftShaderForWebGLName)
use_swift_shader_for_webgl = true;
}
if (use_swift_shader_for_webgl)
return ComputeGpuFeatureInfoForSwiftShader();
GpuFeatureInfo gpu_feature_info;
std::set<int> blacklisted_features;
if (!ignore_gpu_blacklist &&
!command_line->HasSwitch(switches::kUseGpuInTests)) {
std::unique_ptr<GpuBlacklist> list(GpuBlacklist::Create());
if (log_gpu_control_list_decisions)
list->EnableControlListLogging("gpu_blacklist");
unsigned target_test_group = 0u;
if (command_line->HasSwitch(switches::kGpuBlacklistTestGroup)) {
std::string test_group_string =
command_line->GetSwitchValueASCII(switches::kGpuBlacklistTestGroup);
if (!base::StringToUint(test_group_string, &target_test_group))
target_test_group = 0u;
}
blacklisted_features = list->MakeDecision(
GpuControlList::kOsAny, std::string(), gpu_info, target_test_group);
gpu_feature_info.applied_gpu_blacklist_entries = list->GetActiveEntries();
if (needs_more_info) {
*needs_more_info = list->needs_more_info();
}
}
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] =
GetGpuRasterizationFeatureStatus(blacklisted_features, *command_line);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] =
GetWebGLFeatureStatus(blacklisted_features, use_swift_shader);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL2] =
GetWebGL2FeatureStatus(blacklisted_features, use_swift_shader);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] =
Get2DCanvasFeatureStatus(blacklisted_features, use_swift_shader);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] =
GetFlash3DFeatureStatus(blacklisted_features, use_swift_shader);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH_STAGE3D] =
GetFlashStage3DFeatureStatus(blacklisted_features, use_swift_shader);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE] =
GetFlashStage3DBaselineFeatureStatus(blacklisted_features,
use_swift_shader);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] =
GetAcceleratedVideoDecodeFeatureStatus(blacklisted_features,
use_swift_shader);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] =
GetGpuCompositingFeatureStatus(blacklisted_features, use_swift_shader);
#if DCHECK_IS_ON()
for (int ii = 0; ii < NUMBER_OF_GPU_FEATURE_TYPES; ++ii) {
DCHECK_NE(kGpuFeatureStatusUndefined, gpu_feature_info.status_values[ii]);
}
#endif
gl::ExtensionSet all_disabled_extensions;
std::string disabled_gl_extensions_value =
command_line->GetSwitchValueASCII(switches::kDisableGLExtensions);
if (!disabled_gl_extensions_value.empty()) {
std::vector<base::StringPiece> command_line_disabled_extensions =
base::SplitStringPiece(disabled_gl_extensions_value, ", ;",
base::KEEP_WHITESPACE,
base::SPLIT_WANT_NONEMPTY);
all_disabled_extensions.insert(command_line_disabled_extensions.begin(),
command_line_disabled_extensions.end());
}
std::set<int> enabled_driver_bug_workarounds;
std::vector<std::string> driver_bug_disabled_extensions;
if (!disable_gpu_driver_bug_workarounds) {
std::unique_ptr<gpu::GpuDriverBugList> list(GpuDriverBugList::Create());
unsigned target_test_group = 0u;
if (command_line->HasSwitch(switches::kGpuDriverBugListTestGroup)) {
std::string test_group_string = command_line->GetSwitchValueASCII(
switches::kGpuDriverBugListTestGroup);
if (!base::StringToUint(test_group_string, &target_test_group))
target_test_group = 0u;
}
enabled_driver_bug_workarounds = list->MakeDecision(
GpuControlList::kOsAny, std::string(), gpu_info, target_test_group);
gpu_feature_info.applied_gpu_driver_bug_list_entries =
list->GetActiveEntries();
driver_bug_disabled_extensions = list->GetDisabledExtensions();
all_disabled_extensions.insert(driver_bug_disabled_extensions.begin(),
driver_bug_disabled_extensions.end());
// Disabling WebGL extensions only occurs via the blacklist, so
// the logic is simpler.
gl::ExtensionSet disabled_webgl_extensions;
std::vector<std::string> disabled_webgl_extension_list =
list->GetDisabledWebGLExtensions();
disabled_webgl_extensions.insert(disabled_webgl_extension_list.begin(),
disabled_webgl_extension_list.end());
gpu_feature_info.disabled_webgl_extensions =
gl::MakeExtensionString(disabled_webgl_extensions);
}
gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine(
&enabled_driver_bug_workarounds, *command_line);
gpu_feature_info.enabled_gpu_driver_bug_workarounds.insert(
gpu_feature_info.enabled_gpu_driver_bug_workarounds.begin(),
enabled_driver_bug_workarounds.begin(),
enabled_driver_bug_workarounds.end());
if (all_disabled_extensions.size()) {
gpu_feature_info.disabled_extensions =
gl::MakeExtensionString(all_disabled_extensions);
}
AdjustGpuFeatureStatusToWorkarounds(&gpu_feature_info);
// TODO(zmo): Find a better way to communicate these settings to bindings
// initialization than commandline switches.
AppendWorkaroundsToCommandLine(gpu_feature_info, command_line);
return gpu_feature_info;
}
void SetKeysForCrashLogging(const GPUInfo& gpu_info) {
#if !defined(OS_ANDROID)
crash_keys::gpu_vendor_id.Set(
base::StringPrintf("0x%04x", gpu_info.gpu.vendor_id));
crash_keys::gpu_device_id.Set(
base::StringPrintf("0x%04x", gpu_info.gpu.device_id));
#endif
crash_keys::gpu_driver_version.Set(gpu_info.driver_version);
crash_keys::gpu_pixel_shader_version.Set(gpu_info.pixel_shader_version);
crash_keys::gpu_vertex_shader_version.Set(gpu_info.vertex_shader_version);
#if defined(OS_MACOSX)
crash_keys::gpu_gl_version.Set(gpu_info.gl_version);
#elif defined(OS_POSIX)
crash_keys::gpu_vendor.Set(gpu_info.gl_vendor);
crash_keys::gpu_renderer.Set(gpu_info.gl_renderer);
#endif
}
void CacheGPUInfo(const GPUInfo& gpu_info) {
DCHECK(!g_gpu_info_cache);
g_gpu_info_cache = new GPUInfo;
*g_gpu_info_cache = gpu_info;
}
bool PopGPUInfoCache(GPUInfo* gpu_info) {
if (!g_gpu_info_cache)
return false;
*gpu_info = *g_gpu_info_cache;
delete g_gpu_info_cache;
g_gpu_info_cache = nullptr;
return true;
}
void CacheGpuFeatureInfo(const GpuFeatureInfo& gpu_feature_info) {
DCHECK(!g_gpu_feature_info_cache);
g_gpu_feature_info_cache = new GpuFeatureInfo;
*g_gpu_feature_info_cache = gpu_feature_info;
}
bool PopGpuFeatureInfoCache(GpuFeatureInfo* gpu_feature_info) {
if (!g_gpu_feature_info_cache)
return false;
*gpu_feature_info = *g_gpu_feature_info_cache;
delete g_gpu_feature_info_cache;
g_gpu_feature_info_cache = nullptr;
return true;
}
#if defined(OS_ANDROID)
bool InitializeGLThreadSafe(base::CommandLine* command_line,
bool ignore_gpu_blacklist,
bool disable_gpu_driver_bug_workarounds,
bool log_gpu_control_list_decisions,
GPUInfo* out_gpu_info,
GpuFeatureInfo* out_gpu_feature_info) {
static base::NoDestructor<base::Lock> gl_bindings_initialization_lock;
base::AutoLock auto_lock(*gl_bindings_initialization_lock);
DCHECK(command_line);
DCHECK(out_gpu_info && out_gpu_feature_info);
bool gpu_info_cached = PopGPUInfoCache(out_gpu_info);
bool gpu_feature_info_cached = PopGpuFeatureInfoCache(out_gpu_feature_info);
DCHECK_EQ(gpu_info_cached, gpu_feature_info_cached);
if (gpu_info_cached) {
// GL bindings have already been initialized in another thread.
DCHECK_NE(gl::kGLImplementationNone, gl::GetGLImplementation());
return true;
}
if (gl::GetGLImplementation() == gl::kGLImplementationNone) {
// Some tests initialize bindings by themselves.
if (!gl::init::InitializeGLNoExtensionsOneOff()) {
VLOG(1) << "gl::init::InitializeGLNoExtensionsOneOff failed";
return false;
}
}
CollectContextGraphicsInfo(out_gpu_info);
*out_gpu_feature_info = ComputeGpuFeatureInfo(
*out_gpu_info, ignore_gpu_blacklist, disable_gpu_driver_bug_workarounds,
log_gpu_control_list_decisions, command_line, nullptr);
if (!out_gpu_feature_info->disabled_extensions.empty()) {
gl::init::SetDisabledExtensionsPlatform(
out_gpu_feature_info->disabled_extensions);
}
if (!gl::init::InitializeExtensionSettingsOneOffPlatform()) {
VLOG(1) << "gl::init::InitializeExtensionSettingsOneOffPlatform failed";
return false;
}
CacheGPUInfo(*out_gpu_info);
CacheGpuFeatureInfo(*out_gpu_feature_info);
return true;
}
#endif // OS_ANDROID
} // namespace gpu
|