OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "gpu/command_buffer/service/feature_info.h" | 7 #include "gpu/command_buffer/service/feature_info.h" |
8 #include "gpu/command_buffer/service/gl_utils.h" | 8 #include "gpu/command_buffer/service/gl_utils.h" |
9 #include "gpu/GLES2/gles2_command_buffer.h" | 9 #include "gpu/GLES2/gles2_command_buffer.h" |
10 #include "ui/gfx/gl/gl_implementation.h" | 10 #include "ui/gfx/gl/gl_implementation.h" |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 325 |
326 if (ext.HaveAndDesire("GL_OES_standard_derivatives") || | 326 if (ext.HaveAndDesire("GL_OES_standard_derivatives") || |
327 (gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL && | 327 (gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL && |
328 ext.Desire("GL_OES_standard_derivatives"))) { | 328 ext.Desire("GL_OES_standard_derivatives"))) { |
329 AddExtensionString("GL_OES_standard_derivatives"); | 329 AddExtensionString("GL_OES_standard_derivatives"); |
330 feature_flags_.oes_standard_derivatives = true; | 330 feature_flags_.oes_standard_derivatives = true; |
331 validators_.hint_target.AddValue(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES); | 331 validators_.hint_target.AddValue(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES); |
332 validators_.g_l_state.AddValue(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES); | 332 validators_.g_l_state.AddValue(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES); |
333 } | 333 } |
334 | 334 |
| 335 if (ext.HaveAndDesire("GL_OES_EGL_image_external")) { |
| 336 AddExtensionString("GL_OES_EGL_image_external"); |
| 337 feature_flags_.oes_egl_image_external = true; |
| 338 validators_.texture_bind_target.AddValue(GL_TEXTURE_EXTERNAL_OES); |
| 339 validators_.get_tex_param_target.AddValue(GL_TEXTURE_EXTERNAL_OES); |
| 340 validators_.texture_parameter.AddValue(GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES); |
| 341 validators_.g_l_state.AddValue(GL_TEXTURE_BINDING_EXTERNAL_OES); |
| 342 } |
| 343 |
335 // TODO(gman): Add support for these extensions. | 344 // TODO(gman): Add support for these extensions. |
336 // GL_OES_depth32 | 345 // GL_OES_depth32 |
337 // GL_OES_element_index_uint | 346 // GL_OES_element_index_uint |
338 | 347 |
339 feature_flags_.enable_texture_float_linear = enable_texture_float_linear; | 348 feature_flags_.enable_texture_float_linear = enable_texture_float_linear; |
340 feature_flags_.enable_texture_half_float_linear = | 349 feature_flags_.enable_texture_half_float_linear = |
341 enable_texture_half_float_linear; | 350 enable_texture_half_float_linear; |
342 feature_flags_.npot_ok = npot_ok; | 351 feature_flags_.npot_ok = npot_ok; |
343 } | 352 } |
344 | 353 |
345 void FeatureInfo::AddExtensionString(const std::string& str) { | 354 void FeatureInfo::AddExtensionString(const std::string& str) { |
346 if (extensions_.find(str) == std::string::npos) { | 355 if (extensions_.find(str) == std::string::npos) { |
347 extensions_ += (extensions_.empty() ? "" : " ") + str; | 356 extensions_ += (extensions_.empty() ? "" : " ") + str; |
348 } | 357 } |
349 } | 358 } |
350 | 359 |
351 } // namespace gles2 | 360 } // namespace gles2 |
352 } // namespace gpu | 361 } // namespace gpu |
OLD | NEW |