1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "gpu/command_buffer/service/gpu_switches.h"
6#include "base/basictypes.h"
7
8namespace switches {
9
10// Always return success when compiling a shader. Linking will still fail.
11const char kCompileShaderAlwaysSucceeds[]   = "compile-shader-always-succeeds";
12
13// Disable the GL error log limit.
14const char kDisableGLErrorLimit[]           = "disable-gl-error-limit";
15
16// Disable the GLSL translator.
17const char kDisableGLSLTranslator[]         = "disable-glsl-translator";
18
19// Disable workarounds for various GPU driver bugs.
20const char kDisableGpuDriverBugWorkarounds[] =
21    "disable-gpu-driver-bug-workarounds";
22
23// Turn off user-defined name hashing in shaders.
24const char kDisableShaderNameHashing[]      = "disable-shader-name-hashing";
25
26// Turn on Logging GPU commands.
27const char kEnableGPUCommandLogging[]       = "enable-gpu-command-logging";
28
29// Turn on Calling GL Error after every command.
30const char kEnableGPUDebugging[]            = "enable-gpu-debugging";
31
32// Enable GPU service logging. Note: This is the same switch as the one in
33// gl_switches.cc. It's defined here again to avoid dependencies between
34// dlls.
35const char kEnableGPUServiceLoggingGPU[]    = "enable-gpu-service-logging";
36
37// Turn off gpu program caching
38const char kDisableGpuProgramCache[]        = "disable-gpu-program-cache";
39
40// Enforce GL minimums.
41const char kEnforceGLMinimums[]             = "enforce-gl-minimums";
42
43// Sets the total amount of memory that may be allocated for GPU resources
44const char kForceGpuMemAvailableMb[]        = "force-gpu-mem-available-mb";
45
46// Pass a set of GpuDriverBugWorkaroundType ids, seperated by ','.
47const char kGpuDriverBugWorkarounds[] = "gpu-driver-bug-workarounds";
48
49// Sets the maximum size of the in-memory gpu program cache, in kb
50const char kGpuProgramCacheSizeKb[]         = "gpu-program-cache-size-kb";
51
52// Disables the GPU shader on disk cache.
53const char kDisableGpuShaderDiskCache[]     = "disable-gpu-shader-disk-cache";
54
55// Allows async texture uploads (off main thread) via GL context sharing.
56const char kEnableShareGroupAsyncTextureUpload[] =
57    "enable-share-group-async-texture-upload";
58
59const char* kGpuSwitches[] = {
60  kCompileShaderAlwaysSucceeds,
61  kDisableGLErrorLimit,
62  kDisableGLSLTranslator,
63  kDisableGpuDriverBugWorkarounds,
64  kDisableShaderNameHashing,
65  kEnableGPUCommandLogging,
66  kEnableGPUDebugging,
67  kEnableGPUServiceLoggingGPU,
68  kDisableGpuProgramCache,
69  kEnforceGLMinimums,
70  kForceGpuMemAvailableMb,
71  kGpuDriverBugWorkarounds,
72  kGpuProgramCacheSizeKb,
73  kDisableGpuShaderDiskCache,
74  kEnableShareGroupAsyncTextureUpload,
75};
76
77const int kNumGpuSwitches = arraysize(kGpuSwitches);
78
79}  // namespace switches
80