OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "gpu/command_buffer/service/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 if (extensions.Contains("GL_EXT_shader_texture_lod") || | 841 if (extensions.Contains("GL_EXT_shader_texture_lod") || |
842 gfx::HasDesktopGLFeatures()) { | 842 gfx::HasDesktopGLFeatures()) { |
843 AddExtensionString("GL_EXT_shader_texture_lod"); | 843 AddExtensionString("GL_EXT_shader_texture_lod"); |
844 feature_flags_.ext_shader_texture_lod = true; | 844 feature_flags_.ext_shader_texture_lod = true; |
845 } | 845 } |
846 | 846 |
847 #if !defined(OS_MACOSX) | 847 #if !defined(OS_MACOSX) |
848 if (workarounds_.disable_egl_khr_fence_sync) { | 848 if (workarounds_.disable_egl_khr_fence_sync) { |
849 gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync = false; | 849 gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync = false; |
850 } | 850 } |
| 851 if (workarounds_.disable_egl_khr_wait_sync) { |
| 852 gfx::g_driver_egl.ext.b_EGL_KHR_wait_sync = false; |
| 853 } |
851 #endif | 854 #endif |
852 if (workarounds_.disable_arb_sync) | 855 if (workarounds_.disable_arb_sync) |
853 gfx::g_driver_gl.ext.b_GL_ARB_sync = false; | 856 gfx::g_driver_gl.ext.b_GL_ARB_sync = false; |
854 bool ui_gl_fence_works = gfx::GLFence::IsSupported(); | 857 bool ui_gl_fence_works = gfx::GLFence::IsSupported(); |
855 UMA_HISTOGRAM_BOOLEAN("GPU.FenceSupport", ui_gl_fence_works); | 858 UMA_HISTOGRAM_BOOLEAN("GPU.FenceSupport", ui_gl_fence_works); |
856 | 859 |
857 feature_flags_.map_buffer_range = | 860 feature_flags_.map_buffer_range = |
858 is_es3 || extensions.Contains("GL_ARB_map_buffer_range"); | 861 is_es3 || extensions.Contains("GL_ARB_map_buffer_range") || |
| 862 extensions.Contains("GL_EXT_map_buffer_range"); |
859 | 863 |
860 // Really it's part of core OpenGL 2.1 and up, but let's assume the | 864 // Really it's part of core OpenGL 2.1 and up, but let's assume the |
861 // extension is still advertised. | 865 // extension is still advertised. |
862 bool has_pixel_buffers = | 866 bool has_pixel_buffers = |
863 is_es3 || extensions.Contains("GL_ARB_pixel_buffer_object"); | 867 is_es3 || extensions.Contains("GL_ARB_pixel_buffer_object") || |
| 868 extensions.Contains("GL_NV_pixel_buffer_object"); |
864 | 869 |
865 // We will use either glMapBuffer() or glMapBufferRange() for async readbacks. | 870 // We will use either glMapBuffer() or glMapBufferRange() for async readbacks. |
866 if (has_pixel_buffers && ui_gl_fence_works && | 871 if (has_pixel_buffers && ui_gl_fence_works && |
867 !workarounds_.disable_async_readpixels) { | 872 !workarounds_.disable_async_readpixels) { |
868 feature_flags_.use_async_readpixels = true; | 873 feature_flags_.use_async_readpixels = true; |
869 } | 874 } |
870 | 875 |
871 if (is_es3 || extensions.Contains("GL_ARB_sampler_objects")) { | 876 if (is_es3 || extensions.Contains("GL_ARB_sampler_objects")) { |
872 feature_flags_.enable_samplers = true; | 877 feature_flags_.enable_samplers = true; |
873 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") | 878 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 if (pos == std::string::npos) { | 947 if (pos == std::string::npos) { |
943 extensions_ += (extensions_.empty() ? "" : " ") + str; | 948 extensions_ += (extensions_.empty() ? "" : " ") + str; |
944 } | 949 } |
945 } | 950 } |
946 | 951 |
947 FeatureInfo::~FeatureInfo() { | 952 FeatureInfo::~FeatureInfo() { |
948 } | 953 } |
949 | 954 |
950 } // namespace gles2 | 955 } // namespace gles2 |
951 } // namespace gpu | 956 } // namespace gpu |
OLD | NEW |