OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 #endif | 128 #endif |
129 | 129 |
130 #if !defined(GR_GL_MUST_USE_VBO) | 130 #if !defined(GR_GL_MUST_USE_VBO) |
131 #define GR_GL_MUST_USE_VBO 0 | 131 #define GR_GL_MUST_USE_VBO 0 |
132 #endif | 132 #endif |
133 | 133 |
134 #if !defined(GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE) | 134 #if !defined(GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE) |
135 #define GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE 0 | 135 #define GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE 0 |
136 #endif | 136 #endif |
137 | 137 |
138 /** | |
139 * There is a strange bug that occurs on Macs with NVIDIA GPUs. We don't | |
140 * fully understand it. When (element) array buffers are continually | |
141 * respecified using glBufferData performance can fall off of a cliff. The | |
142 * driver winds up performing many DMA mapping / unmappings and chews up ~50% of | |
143 * the core. However, it has been observed that occaisonally respecifiying the | |
144 * buffer using glBufferData and then writing data using glBufferSubData | |
145 * prevents the bad behavior. | |
146 * | |
147 * There is a lot of uncertainty around this issue. In Chrome backgrounding | |
148 * the tab somehow initiates this behavior and we don't know what the connection | |
149 * is. Another observation is that Chrome's cmd buffer server will actually | |
150 * create a buffer full of zeros when it sees a NULL data param (for security | |
151 * reasons). If this is disabled and NULL is actually passed all the way to the | |
152 * driver then the workaround doesn't help. | |
153 * | |
154 * The issue is tracked at: | |
155 * http://code.google.com/p/chromium/issues/detail?id=114865 | |
156 * | |
157 * When the workaround is enabled we will use the glBufferData / glBufferSubData | |
158 * trick every 128 array buffer uploads. | |
159 * | |
160 * Hopefully we will understand this better and have a cleaner fix or get a | |
161 * OS/driver level fix. | |
162 */ | |
163 #if (defined(SK_BUILD_FOR_MAC) && !GR_GL_USE_BUFFER_DATA_NULL_HINT) | |
164 # define GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND 1 | |
165 #else | |
166 # define GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND 0 | |
167 #endif | 138 #endif |
168 | |
169 #endif | |
OLD | NEW |