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