Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / gpu / command_buffer / service / gpu_switches.cc
blob171f543b7d44e11b32df43eddf996d04712fa9bc
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"
7 #include "base/macros.h"
9 namespace switches {
11 // Always return success when compiling a shader. Linking will still fail.
12 const char kCompileShaderAlwaysSucceeds[] = "compile-shader-always-succeeds";
14 // Disable the GL error log limit.
15 const char kDisableGLErrorLimit[] = "disable-gl-error-limit";
17 // Disable the GLSL translator.
18 const char kDisableGLSLTranslator[] = "disable-glsl-translator";
20 // Disable workarounds for various GPU driver bugs.
21 const char kDisableGpuDriverBugWorkarounds[] =
22 "disable-gpu-driver-bug-workarounds";
24 // Turn off user-defined name hashing in shaders.
25 const char kDisableShaderNameHashing[] = "disable-shader-name-hashing";
27 // Turn on Logging GPU commands.
28 const char kEnableGPUCommandLogging[] = "enable-gpu-command-logging";
30 // Turn on Calling GL Error after every command.
31 const char kEnableGPUDebugging[] = "enable-gpu-debugging";
33 // Enable GPU service logging. Note: This is the same switch as the one in
34 // gl_switches.cc. It's defined here again to avoid dependencies between
35 // dlls.
36 const char kEnableGPUServiceLoggingGPU[] = "enable-gpu-service-logging";
38 // Turn off gpu program caching
39 const char kDisableGpuProgramCache[] = "disable-gpu-program-cache";
41 // Enforce GL minimums.
42 const char kEnforceGLMinimums[] = "enforce-gl-minimums";
44 // Sets the total amount of memory that may be allocated for GPU resources
45 const char kForceGpuMemAvailableMb[] = "force-gpu-mem-available-mb";
47 // Sets the maximum size of the in-memory gpu program cache, in kb
48 const char kGpuProgramCacheSizeKb[] = "gpu-program-cache-size-kb";
50 // Disables the GPU shader on disk cache.
51 const char kDisableGpuShaderDiskCache[] = "disable-gpu-shader-disk-cache";
53 // Allows async texture uploads (off main thread) via GL context sharing.
54 const char kEnableShareGroupAsyncTextureUpload[] =
55 "enable-share-group-async-texture-upload";
57 // Enable WebGL subscribe uniform extension.
58 const char kEnableSubscribeUniformExtension[] =
59 "enable-subscribe-uniform-extension";
61 // Simulates shared textures when share groups are not available. Not available
62 // everywhere.
63 const char kEnableThreadedTextureMailboxes[] =
64 "enable-threaded-texture-mailboxes";
66 // Include ANGLE's intermediate representation (AST) output in shader
67 // compilation info logs.
68 const char kGLShaderIntermOutput[] = "gl-shader-interm-output";
70 // Emulate ESSL lowp and mediump float precisions by mutating the shaders to
71 // round intermediate values in ANGLE.
72 const char kEmulateShaderPrecision[] = "emulate-shader-precision";
74 // Enables using path rendering implementation implemented currently
75 // in NV_path_rendering OpenGL extension. Requires compatible hardware
76 // and driver. This is used in GPU rasterization.
77 const char kEnableGLPathRendering[] = "enable-gl-path-rendering";
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 kEnableSubscribeUniformExtension,
96 kGLShaderIntermOutput,
97 kEmulateShaderPrecision,
98 kEnableGLPathRendering,
101 const int kNumGpuSwitches = arraysize(kGpuSwitches);
103 } // namespace switches