Make GL bindings conditional
[chromium-blink-merge.git] / gpu / command_buffer / service / gpu_switches.cc
bloba2d43e9c4dfd7f18772d7dbe47f2dcfb9266a4dd
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.
5 #include "gpu/command_buffer/service/gpu_switches.h"
6 #include "base/basictypes.h"
8 namespace switches {
10 // Always return success when compiling a shader. Linking will still fail.
11 const char kCompileShaderAlwaysSucceeds[] = "compile-shader-always-succeeds";
13 // Disable the GL error log limit.
14 const char kDisableGLErrorLimit[] = "disable-gl-error-limit";
16 // Disable the GLSL translator.
17 const char kDisableGLSLTranslator[] = "disable-glsl-translator";
19 // Disable workarounds for various GPU driver bugs.
20 const char kDisableGpuDriverBugWorkarounds[] =
21 "disable-gpu-driver-bug-workarounds";
23 // Turn off user-defined name hashing in shaders.
24 const char kDisableShaderNameHashing[] = "disable-shader-name-hashing";
26 // Turn on Logging GPU commands.
27 const char kEnableGPUCommandLogging[] = "enable-gpu-command-logging";
29 // Turn on Calling GL Error after every command.
30 const char kEnableGPUDebugging[] = "enable-gpu-debugging";
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.
35 const char kEnableGPUServiceLoggingGPU[] = "enable-gpu-service-logging";
37 // Turn off gpu program caching
38 const char kDisableGpuProgramCache[] = "disable-gpu-program-cache";
40 // Enforce GL minimums.
41 const char kEnforceGLMinimums[] = "enforce-gl-minimums";
43 // Sets the total amount of memory that may be allocated for GPU resources
44 const char kForceGpuMemAvailableMb[] = "force-gpu-mem-available-mb";
46 // Pass a set of GpuDriverBugWorkaroundType ids, seperated by ','.
47 const char kGpuDriverBugWorkarounds[] = "gpu-driver-bug-workarounds";
49 // Sets the maximum size of the in-memory gpu program cache, in kb
50 const char kGpuProgramCacheSizeKb[] = "gpu-program-cache-size-kb";
52 // Disables the GPU shader on disk cache.
53 const char kDisableGpuShaderDiskCache[] = "disable-gpu-shader-disk-cache";
55 // Allows async texture uploads (off main thread) via GL context sharing.
56 const char kEnableShareGroupAsyncTextureUpload[] =
57 "enable-share-group-async-texture-upload";
59 // Enable WebGL subscribe uniform extension.
60 const char kEnableSubscribeUniformExtension[] =
61 "enable-subscribe-uniform-extension";
63 // Simulates shared textures when share groups are not available. Not available
64 // everywhere.
65 const char kEnableThreadedTextureMailboxes[] =
66 "enable-threaded-texture-mailboxes";
68 // Enable OpenGL ES 3 APIs without proper service side validation.
69 const char kEnableUnsafeES3APIs[] = "enable-unsafe-es3-apis";
71 // Include ANGLE's intermediate representation (AST) output in shader
72 // compilation info logs.
73 const char kGLShaderIntermOutput[] = "gl-shader-interm-output";
75 // Emulate ESSL lowp and mediump float precisions by mutating the shaders to
76 // round intermediate values in ANGLE.
77 const char kEmulateShaderPrecision[] = "emulate-shader-precision";
79 const char* kGpuSwitches[] = {
80 kCompileShaderAlwaysSucceeds,
81 kDisableGLErrorLimit,
82 kDisableGLSLTranslator,
83 kDisableGpuDriverBugWorkarounds,
84 kDisableShaderNameHashing,
85 kEnableGPUCommandLogging,
86 kEnableGPUDebugging,
87 kEnableGPUServiceLoggingGPU,
88 kDisableGpuProgramCache,
89 kEnforceGLMinimums,
90 kForceGpuMemAvailableMb,
91 kGpuDriverBugWorkarounds,
92 kGpuProgramCacheSizeKb,
93 kDisableGpuShaderDiskCache,
94 kEnableShareGroupAsyncTextureUpload,
95 kEnableUnsafeES3APIs,
96 kEnableSubscribeUniformExtension,
97 kGLShaderIntermOutput,
98 kEmulateShaderPrecision,
101 const int kNumGpuSwitches = arraysize(kGpuSwitches);
103 } // namespace switches