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 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 chromium_path_rendering(false), | 170 chromium_path_rendering(false), |
171 blend_equation_advanced(false), | 171 blend_equation_advanced(false), |
172 blend_equation_advanced_coherent(false), | 172 blend_equation_advanced_coherent(false), |
173 ext_texture_rg(false), | 173 ext_texture_rg(false), |
174 chromium_image_ycbcr_420v(false), | 174 chromium_image_ycbcr_420v(false), |
175 chromium_image_ycbcr_422(false), | 175 chromium_image_ycbcr_422(false), |
176 enable_subscribe_uniform(false), | 176 enable_subscribe_uniform(false), |
177 emulate_primitive_restart_fixed_index(false), | 177 emulate_primitive_restart_fixed_index(false), |
178 ext_render_buffer_format_bgra8888(false), | 178 ext_render_buffer_format_bgra8888(false), |
179 ext_multisample_compatibility(false), | 179 ext_multisample_compatibility(false), |
180 ext_blend_func_extended(false) {} | 180 ext_framebuffer_srgb(false) {} |
181 | 181 |
182 FeatureInfo::Workarounds::Workarounds() : | 182 FeatureInfo::Workarounds::Workarounds() : |
183 #define GPU_OP(type, name) name(false), | 183 #define GPU_OP(type, name) name(false), |
184 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 184 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
185 #undef GPU_OP | 185 #undef GPU_OP |
186 max_texture_size(0), | 186 max_texture_size(0), |
187 max_cube_map_texture_size(0), | 187 max_cube_map_texture_size(0), |
188 max_fragment_uniform_vectors(0), | 188 max_fragment_uniform_vectors(0), |
189 max_varying_vectors(0), | 189 max_varying_vectors(0), |
190 max_vertex_uniform_vectors(0), | 190 max_vertex_uniform_vectors(0), |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 validators_.texture_internal_format.AddValue(GL_R8_EXT); | 1181 validators_.texture_internal_format.AddValue(GL_R8_EXT); |
1182 validators_.texture_internal_format.AddValue(GL_RG_EXT); | 1182 validators_.texture_internal_format.AddValue(GL_RG_EXT); |
1183 validators_.texture_internal_format.AddValue(GL_RG8_EXT); | 1183 validators_.texture_internal_format.AddValue(GL_RG8_EXT); |
1184 validators_.read_pixel_format.AddValue(GL_RED_EXT); | 1184 validators_.read_pixel_format.AddValue(GL_RED_EXT); |
1185 validators_.read_pixel_format.AddValue(GL_RG_EXT); | 1185 validators_.read_pixel_format.AddValue(GL_RG_EXT); |
1186 validators_.render_buffer_format.AddValue(GL_R8_EXT); | 1186 validators_.render_buffer_format.AddValue(GL_R8_EXT); |
1187 validators_.render_buffer_format.AddValue(GL_RG8_EXT); | 1187 validators_.render_buffer_format.AddValue(GL_RG8_EXT); |
1188 } | 1188 } |
1189 UMA_HISTOGRAM_BOOLEAN("GPU.TextureRG", feature_flags_.ext_texture_rg); | 1189 UMA_HISTOGRAM_BOOLEAN("GPU.TextureRG", feature_flags_.ext_texture_rg); |
1190 | 1190 |
| 1191 if (extensions.Contains("GL_ARB_framebuffer_sRGB") || |
| 1192 extensions.Contains("GLX_ARB_framebuffer_sRGB") || |
| 1193 extensions.Contains("WGL_ARB_framebuffer_sRGB")) { |
| 1194 feature_flags_.ext_framebuffer_srgb = true; |
| 1195 AddExtensionString("GL_ARB_framebuffer_sRGB"); |
| 1196 } |
| 1197 |
1191 bool has_opengl_dual_source_blending = | 1198 bool has_opengl_dual_source_blending = |
1192 gl_version_info_->IsAtLeastGL(3, 3) || | 1199 gl_version_info_->IsAtLeastGL(3, 3) || |
1193 (gl_version_info_->IsAtLeastGL(3, 2) && | 1200 (gl_version_info_->IsAtLeastGL(3, 2) && |
1194 extensions.Contains("GL_ARB_blend_func_extended")); | 1201 extensions.Contains("GL_ARB_blend_func_extended")); |
1195 if (!disable_shader_translator_ && | 1202 if (!disable_shader_translator_ && |
1196 ((gl_version_info_->IsAtLeastGL(3, 2) && | 1203 ((gl_version_info_->IsAtLeastGL(3, 2) && |
1197 has_opengl_dual_source_blending) || | 1204 has_opengl_dual_source_blending) || |
1198 (gl_version_info_->IsAtLeastGLES(3, 0) && | 1205 (gl_version_info_->IsAtLeastGLES(3, 0) && |
1199 extensions.Contains("GL_EXT_blend_func_extended")))) { | 1206 extensions.Contains("GL_EXT_blend_func_extended")))) { |
1200 // Note: to simplify the code, we do not expose EXT_blend_func_extended | 1207 // Note: to simplify the code, we do not expose EXT_blend_func_extended |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 if (pos == std::string::npos) { | 1339 if (pos == std::string::npos) { |
1333 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1340 extensions_ += (extensions_.empty() ? "" : " ") + str; |
1334 } | 1341 } |
1335 } | 1342 } |
1336 | 1343 |
1337 FeatureInfo::~FeatureInfo() { | 1344 FeatureInfo::~FeatureInfo() { |
1338 } | 1345 } |
1339 | 1346 |
1340 } // namespace gles2 | 1347 } // namespace gles2 |
1341 } // namespace gpu | 1348 } // namespace gpu |
OLD | NEW |