Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1242 validators_.render_buffer_format.AddValue(GL_RG8_EXT); | 1242 validators_.render_buffer_format.AddValue(GL_RG8_EXT); |
| 1243 validators_.texture_unsized_internal_format.AddValue(GL_RED_EXT); | 1243 validators_.texture_unsized_internal_format.AddValue(GL_RED_EXT); |
| 1244 validators_.texture_unsized_internal_format.AddValue(GL_RG_EXT); | 1244 validators_.texture_unsized_internal_format.AddValue(GL_RG_EXT); |
| 1245 } | 1245 } |
| 1246 UMA_HISTOGRAM_BOOLEAN("GPU.TextureRG", feature_flags_.ext_texture_rg); | 1246 UMA_HISTOGRAM_BOOLEAN("GPU.TextureRG", feature_flags_.ext_texture_rg); |
| 1247 | 1247 |
| 1248 bool has_opengl_dual_source_blending = | 1248 bool has_opengl_dual_source_blending = |
| 1249 gl_version_info_->IsAtLeastGL(3, 3) || | 1249 gl_version_info_->IsAtLeastGL(3, 3) || |
| 1250 (gl_version_info_->IsAtLeastGL(3, 2) && | 1250 (gl_version_info_->IsAtLeastGL(3, 2) && |
| 1251 extensions.Contains("GL_ARB_blend_func_extended")); | 1251 extensions.Contains("GL_ARB_blend_func_extended")); |
| 1252 | |
| 1253 if (gl_version_info_->IsAtLeastGLES(3, 0) || | |
| 1254 has_opengl_dual_source_blending) { | |
| 1255 // NOTE: SRC_ALPHA_SATURATE is valid for ES2 src blend factor. | |
| 1256 // SRC_ALPHA_SATURATE is valid for ES3 src and dst blend factor. | |
| 1257 validators_.dst_blend_factor.AddValue(GL_SRC_ALPHA_SATURATE); | |
|
Zhenyao Mo
2016/05/31 02:05:30
This isn't the right fix for this.
Instead, you s
| |
| 1258 } | |
| 1259 | |
| 1252 if (!disable_shader_translator_ && | 1260 if (!disable_shader_translator_ && |
| 1253 ((gl_version_info_->IsAtLeastGL(3, 2) && | 1261 (has_opengl_dual_source_blending || |
| 1254 has_opengl_dual_source_blending) || | |
| 1255 (gl_version_info_->IsAtLeastGLES(3, 0) && | 1262 (gl_version_info_->IsAtLeastGLES(3, 0) && |
| 1256 extensions.Contains("GL_EXT_blend_func_extended")))) { | 1263 extensions.Contains("GL_EXT_blend_func_extended")))) { |
| 1257 // Note: to simplify the code, we do not expose EXT_blend_func_extended | 1264 // Note: to simplify the code, we do not expose EXT_blend_func_extended |
| 1258 // unless the service context supports ES 3.0. This means the theoretical ES | 1265 // unless the service context supports ES 3.0. This means the theoretical ES |
| 1259 // 2.0 implementation with EXT_blend_func_extended is not sufficient. | 1266 // 2.0 implementation with EXT_blend_func_extended is not sufficient. |
| 1260 feature_flags_.ext_blend_func_extended = true; | 1267 feature_flags_.ext_blend_func_extended = true; |
| 1261 AddExtensionString("GL_EXT_blend_func_extended"); | 1268 AddExtensionString("GL_EXT_blend_func_extended"); |
| 1262 | 1269 |
| 1263 // NOTE: SRC_ALPHA_SATURATE is valid for ES2 src blend factor. | |
| 1264 // SRC_ALPHA_SATURATE is valid for ES3 src and dst blend factor. | |
| 1265 validators_.dst_blend_factor.AddValue(GL_SRC_ALPHA_SATURATE_EXT); | |
| 1266 | |
| 1267 validators_.src_blend_factor.AddValue(GL_SRC1_ALPHA_EXT); | 1270 validators_.src_blend_factor.AddValue(GL_SRC1_ALPHA_EXT); |
| 1268 validators_.dst_blend_factor.AddValue(GL_SRC1_ALPHA_EXT); | 1271 validators_.dst_blend_factor.AddValue(GL_SRC1_ALPHA_EXT); |
| 1269 validators_.src_blend_factor.AddValue(GL_SRC1_COLOR_EXT); | 1272 validators_.src_blend_factor.AddValue(GL_SRC1_COLOR_EXT); |
| 1270 validators_.dst_blend_factor.AddValue(GL_SRC1_COLOR_EXT); | 1273 validators_.dst_blend_factor.AddValue(GL_SRC1_COLOR_EXT); |
| 1271 validators_.src_blend_factor.AddValue(GL_ONE_MINUS_SRC1_COLOR_EXT); | 1274 validators_.src_blend_factor.AddValue(GL_ONE_MINUS_SRC1_COLOR_EXT); |
| 1272 validators_.dst_blend_factor.AddValue(GL_ONE_MINUS_SRC1_COLOR_EXT); | 1275 validators_.dst_blend_factor.AddValue(GL_ONE_MINUS_SRC1_COLOR_EXT); |
| 1273 validators_.src_blend_factor.AddValue(GL_ONE_MINUS_SRC1_ALPHA_EXT); | 1276 validators_.src_blend_factor.AddValue(GL_ONE_MINUS_SRC1_ALPHA_EXT); |
| 1274 validators_.dst_blend_factor.AddValue(GL_ONE_MINUS_SRC1_ALPHA_EXT); | 1277 validators_.dst_blend_factor.AddValue(GL_ONE_MINUS_SRC1_ALPHA_EXT); |
| 1275 validators_.g_l_state.AddValue(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT); | 1278 validators_.g_l_state.AddValue(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT); |
| 1276 } | 1279 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1394 if (pos == std::string::npos) { | 1397 if (pos == std::string::npos) { |
| 1395 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1398 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1396 } | 1399 } |
| 1397 } | 1400 } |
| 1398 | 1401 |
| 1399 FeatureInfo::~FeatureInfo() { | 1402 FeatureInfo::~FeatureInfo() { |
| 1400 } | 1403 } |
| 1401 | 1404 |
| 1402 } // namespace gles2 | 1405 } // namespace gles2 |
| 1403 } // namespace gpu | 1406 } // namespace gpu |
| OLD | NEW |