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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 npot_ok(false), | 99 npot_ok(false), |
| 100 enable_texture_float_linear(false), | 100 enable_texture_float_linear(false), |
| 101 enable_texture_half_float_linear(false), | 101 enable_texture_half_float_linear(false), |
| 102 angle_translated_shader_source(false), | 102 angle_translated_shader_source(false), |
| 103 angle_pack_reverse_row_order(false), | 103 angle_pack_reverse_row_order(false), |
| 104 arb_texture_rectangle(false), | 104 arb_texture_rectangle(false), |
| 105 angle_instanced_arrays(false), | 105 angle_instanced_arrays(false), |
| 106 occlusion_query_boolean(false), | 106 occlusion_query_boolean(false), |
| 107 use_arb_occlusion_query2_for_occlusion_query_boolean(false), | 107 use_arb_occlusion_query2_for_occlusion_query_boolean(false), |
| 108 use_arb_occlusion_query_for_occlusion_query_boolean(false), | 108 use_arb_occlusion_query_for_occlusion_query_boolean(false), |
| 109 no_covert_any_samples_passed_conservative_target_for_es3(false), | |
| 110 covert_any_samples_passed_conservative_target_for_low_gl(false), | |
| 109 native_vertex_array_object(false), | 111 native_vertex_array_object(false), |
| 110 ext_texture_format_astc(false), | 112 ext_texture_format_astc(false), |
| 111 ext_texture_format_atc(false), | 113 ext_texture_format_atc(false), |
| 112 ext_texture_format_bgra8888(false), | 114 ext_texture_format_bgra8888(false), |
| 113 ext_texture_format_dxt1(false), | 115 ext_texture_format_dxt1(false), |
| 114 ext_texture_format_dxt5(false), | 116 ext_texture_format_dxt5(false), |
| 115 enable_shader_name_hashing(false), | 117 enable_shader_name_hashing(false), |
| 116 enable_samplers(false), | 118 enable_samplers(false), |
| 117 ext_draw_buffers(false), | 119 ext_draw_buffers(false), |
| 118 nv_draw_buffers(false), | 120 nv_draw_buffers(false), |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1037 validators_.texture_internal_format_storage.AddValue(GL_RGBA16F_EXT); | 1039 validators_.texture_internal_format_storage.AddValue(GL_RGBA16F_EXT); |
| 1038 validators_.texture_internal_format_storage.AddValue(GL_RGB16F_EXT); | 1040 validators_.texture_internal_format_storage.AddValue(GL_RGB16F_EXT); |
| 1039 validators_.texture_internal_format_storage.AddValue(GL_ALPHA16F_EXT); | 1041 validators_.texture_internal_format_storage.AddValue(GL_ALPHA16F_EXT); |
| 1040 validators_.texture_internal_format_storage.AddValue( | 1042 validators_.texture_internal_format_storage.AddValue( |
| 1041 GL_LUMINANCE16F_EXT); | 1043 GL_LUMINANCE16F_EXT); |
| 1042 validators_.texture_internal_format_storage.AddValue( | 1044 validators_.texture_internal_format_storage.AddValue( |
| 1043 GL_LUMINANCE_ALPHA16F_EXT); | 1045 GL_LUMINANCE_ALPHA16F_EXT); |
| 1044 } | 1046 } |
| 1045 } | 1047 } |
| 1046 | 1048 |
| 1047 bool have_es3_occlusion_query = | 1049 bool have_occlusion_query = |
| 1048 gl_version_info_->IsAtLeastGLES(3, 0); | 1050 gl_version_info_->IsAtLeastGLES(3, 0) || |
| 1051 gl_version_info_->IsAtLeastGL(3, 3); | |
| 1049 bool have_ext_occlusion_query_boolean = | 1052 bool have_ext_occlusion_query_boolean = |
| 1050 extensions.Contains("GL_EXT_occlusion_query_boolean"); | 1053 extensions.Contains("GL_EXT_occlusion_query_boolean"); |
| 1051 bool have_arb_occlusion_query2 = | 1054 bool have_arb_occlusion_query2 = |
| 1052 extensions.Contains("GL_ARB_occlusion_query2"); | 1055 extensions.Contains("GL_ARB_occlusion_query2"); |
| 1053 bool have_arb_occlusion_query = | 1056 bool have_arb_occlusion_query = |
| 1054 extensions.Contains("GL_ARB_occlusion_query"); | 1057 extensions.Contains("GL_ARB_occlusion_query"); |
| 1055 | 1058 |
| 1056 if (have_es3_occlusion_query || | 1059 if (have_occlusion_query || |
| 1057 have_ext_occlusion_query_boolean || | 1060 have_ext_occlusion_query_boolean || |
| 1058 have_arb_occlusion_query2 || | 1061 have_arb_occlusion_query2 || |
| 1059 have_arb_occlusion_query) { | 1062 have_arb_occlusion_query) { |
| 1060 if (context_type_ == CONTEXT_TYPE_OPENGLES2) { | 1063 if (context_type_ == CONTEXT_TYPE_OPENGLES2) { |
| 1061 AddExtensionString("GL_EXT_occlusion_query_boolean"); | 1064 AddExtensionString("GL_EXT_occlusion_query_boolean"); |
| 1062 } | 1065 } |
| 1063 feature_flags_.occlusion_query_boolean = true; | 1066 feature_flags_.occlusion_query_boolean = true; |
| 1064 feature_flags_.use_arb_occlusion_query2_for_occlusion_query_boolean = | 1067 feature_flags_.use_arb_occlusion_query2_for_occlusion_query_boolean = |
| 1065 !have_ext_occlusion_query_boolean && have_arb_occlusion_query2; | 1068 !have_ext_occlusion_query_boolean && have_arb_occlusion_query2; |
| 1066 feature_flags_.use_arb_occlusion_query_for_occlusion_query_boolean = | 1069 feature_flags_.use_arb_occlusion_query_for_occlusion_query_boolean = |
| 1067 !have_ext_occlusion_query_boolean && have_arb_occlusion_query && | 1070 !have_ext_occlusion_query_boolean && have_arb_occlusion_query && |
| 1068 !have_arb_occlusion_query2; | 1071 !have_arb_occlusion_query2; |
| 1072 feature_flags_.no_covert_any_samples_passed_conservative_target_for_es3 = | |
|
Zhenyao Mo
2016/07/14 18:09:02
I don't think you need two new flags for this purp
| |
| 1073 gl_version_info_->IsAtLeastGLES(3, 0); | |
| 1074 feature_flags_.covert_any_samples_passed_conservative_target_for_low_gl = | |
| 1075 gl_version_info_->IsAtLeastGL(3, 3) && | |
| 1076 gl_version_info_->IsLowerThanGL(4, 3); | |
| 1069 } | 1077 } |
| 1070 | 1078 |
| 1071 if (!workarounds_.disable_angle_instanced_arrays && | 1079 if (!workarounds_.disable_angle_instanced_arrays && |
| 1072 (extensions.Contains("GL_ANGLE_instanced_arrays") || | 1080 (extensions.Contains("GL_ANGLE_instanced_arrays") || |
| 1073 (extensions.Contains("GL_ARB_instanced_arrays") && | 1081 (extensions.Contains("GL_ARB_instanced_arrays") && |
| 1074 extensions.Contains("GL_ARB_draw_instanced")) || | 1082 extensions.Contains("GL_ARB_draw_instanced")) || |
| 1075 gl_version_info_->is_es3 || | 1083 gl_version_info_->is_es3 || |
| 1076 gl_version_info_->is_desktop_core_profile)) { | 1084 gl_version_info_->is_desktop_core_profile)) { |
| 1077 AddExtensionString("GL_ANGLE_instanced_arrays"); | 1085 AddExtensionString("GL_ANGLE_instanced_arrays"); |
| 1078 feature_flags_.angle_instanced_arrays = true; | 1086 feature_flags_.angle_instanced_arrays = true; |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1417 if (pos == std::string::npos) { | 1425 if (pos == std::string::npos) { |
| 1418 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1426 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1419 } | 1427 } |
| 1420 } | 1428 } |
| 1421 | 1429 |
| 1422 FeatureInfo::~FeatureInfo() { | 1430 FeatureInfo::~FeatureInfo() { |
| 1423 } | 1431 } |
| 1424 | 1432 |
| 1425 } // namespace gles2 | 1433 } // namespace gles2 |
| 1426 } // namespace gpu | 1434 } // namespace gpu |
| OLD | NEW |