OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include "app/gfx/gl/gl_implementation.h" | 7 #include "app/gfx/gl/gl_implementation.h" |
8 #include "gpu/command_buffer/service/feature_info.h" | 8 #include "gpu/command_buffer/service/feature_info.h" |
9 #include "gpu/command_buffer/service/gl_utils.h" | 9 #include "gpu/command_buffer/service/gl_utils.h" |
10 #include "gpu/GLES2/gles2_command_buffer.h" | 10 #include "gpu/GLES2/gles2_command_buffer.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 AddExtensionString("GL_OES_texture_npot"); | 208 AddExtensionString("GL_OES_texture_npot"); |
209 npot_ok = true; | 209 npot_ok = true; |
210 } | 210 } |
211 | 211 |
212 // Check if we should allow GL_OES_texture_float, GL_OES_texture_half_float, | 212 // Check if we should allow GL_OES_texture_float, GL_OES_texture_half_float, |
213 // GL_OES_texture_float_linear, GL_OES_texture_half_float_linear | 213 // GL_OES_texture_float_linear, GL_OES_texture_half_float_linear |
214 bool enable_texture_float = false; | 214 bool enable_texture_float = false; |
215 bool enable_texture_float_linear = false; | 215 bool enable_texture_float_linear = false; |
216 bool enable_texture_half_float = false; | 216 bool enable_texture_half_float = false; |
217 bool enable_texture_half_float_linear = false; | 217 bool enable_texture_half_float_linear = false; |
218 if (ext.HaveAndDesire("GL_ARB_texture_float")) { | 218 |
| 219 bool have_arb_texture_float = ext.Have("GL_ARB_texture_float"); |
| 220 |
| 221 if (have_arb_texture_float && ext.Desire("GL_ARB_texture_float")) { |
219 enable_texture_float = true; | 222 enable_texture_float = true; |
220 enable_texture_float_linear = true; | 223 enable_texture_float_linear = true; |
221 enable_texture_half_float = true; | 224 enable_texture_half_float = true; |
222 enable_texture_half_float_linear = true; | 225 enable_texture_half_float_linear = true; |
223 } else { | 226 } else { |
224 if (ext.HaveAndDesire("GL_OES_texture_float")) { | 227 if (ext.HaveAndDesire("GL_OES_texture_float") || |
| 228 (have_arb_texture_float && |
| 229 ext.Desire("GL_OES_texture_float"))) { |
225 enable_texture_float = true; | 230 enable_texture_float = true; |
226 if (ext.HaveAndDesire("GL_OES_texture_float_linear")) { | 231 if (ext.HaveAndDesire("GL_OES_texture_float_linear") || |
| 232 (have_arb_texture_float && |
| 233 ext.Desire("GL_OES_texture_float_linear"))) { |
227 enable_texture_float_linear = true; | 234 enable_texture_float_linear = true; |
228 } | 235 } |
229 } | 236 } |
230 if (ext.HaveAndDesire("GL_OES_texture_half_float")) { | 237 if (ext.HaveAndDesire("GL_OES_texture_half_float") || |
| 238 (have_arb_texture_float && |
| 239 ext.Desire("GL_OES_texture_half_float"))) { |
231 enable_texture_half_float = true; | 240 enable_texture_half_float = true; |
232 if (ext.HaveAndDesire("GL_OES_texture_half_float_linear")) { | 241 if (ext.HaveAndDesire("GL_OES_texture_half_float_linear") || |
| 242 (have_arb_texture_float && |
| 243 ext.Desire("GL_OES_texture_half_float_linear"))) { |
233 enable_texture_half_float_linear = true; | 244 enable_texture_half_float_linear = true; |
234 } | 245 } |
235 } | 246 } |
236 } | 247 } |
237 | 248 |
238 if (enable_texture_float) { | 249 if (enable_texture_float) { |
239 validators_.pixel_type.AddValue(GL_FLOAT); | 250 validators_.pixel_type.AddValue(GL_FLOAT); |
240 AddExtensionString("GL_OES_texture_float"); | 251 AddExtensionString("GL_OES_texture_float"); |
241 if (enable_texture_float_linear) { | 252 if (enable_texture_float_linear) { |
242 AddExtensionString("GL_OES_texture_float_linear"); | 253 AddExtensionString("GL_OES_texture_float_linear"); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 if (extensions_.find(str) == std::string::npos) { | 304 if (extensions_.find(str) == std::string::npos) { |
294 extensions_ += (extensions_.empty() ? "" : " ") + str; | 305 extensions_ += (extensions_.empty() ? "" : " ") + str; |
295 } | 306 } |
296 } | 307 } |
297 | 308 |
298 } // namespace gles2 | 309 } // namespace gles2 |
299 } // namespace gpu | 310 } // namespace gpu |
300 | 311 |
301 | 312 |
302 | 313 |
OLD | NEW |