Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11050)

Unified Diff: gpu/command_buffer/service/feature_info.cc

Issue 489023002: gpu: Enable relevant extentions on GLES3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittest failure; exclude EXT_draw_buffers Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/feature_info.cc
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index de3eb5623ef77375cdcb2cb5091abb0413f575e4..6f627a539e2b7a4edef1497bd7af4841ecf7fc66 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -228,8 +228,6 @@ void FeatureInfo::InitializeFeatures() {
StringSet extensions(
reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)));
- bool npot_ok = false;
-
const char* renderer_str =
reinterpret_cast<const char*>(glGetString(GL_RENDERER));
if (renderer_str) {
@@ -374,7 +372,7 @@ void FeatureInfo::InitializeFeatures() {
validators_.render_buffer_format.AddValue(GL_DEPTH24_STENCIL8);
}
- if (extensions.Contains("GL_OES_vertex_array_object") ||
+ if (is_es3 || extensions.Contains("GL_OES_vertex_array_object") ||
extensions.Contains("GL_ARB_vertex_array_object") ||
extensions.Contains("GL_APPLE_vertex_array_object")) {
feature_flags_.native_vertex_array_object = true;
@@ -387,7 +385,7 @@ void FeatureInfo::InitializeFeatures() {
feature_flags_.native_vertex_array_object = false;
}
- if (extensions.Contains("GL_OES_element_index_uint") ||
+ if (is_es3 || extensions.Contains("GL_OES_element_index_uint") ||
gfx::HasDesktopGLFeatures()) {
AddExtensionString("GL_OES_element_index_uint");
validators_.index_type.AddValue(GL_UNSIGNED_INT);
@@ -438,10 +436,10 @@ void FeatureInfo::InitializeFeatures() {
}
// Check if we should allow GL_OES_texture_npot
- if (extensions.Contains("GL_ARB_texture_non_power_of_two") ||
+ if (is_es3 || extensions.Contains("GL_ARB_texture_non_power_of_two") ||
extensions.Contains("GL_OES_texture_npot")) {
AddExtensionString("GL_OES_texture_npot");
- npot_ok = true;
+ feature_flags_.npot_ok |= true;
piman 2014/08/28 18:17:39 nit: feature_flags_.npot_ok = true
dshwang 2014/08/29 07:49:09 Done.
}
// Check if we should allow GL_OES_texture_float, GL_OES_texture_half_float,
@@ -460,7 +458,7 @@ void FeatureInfo::InitializeFeatures() {
enable_texture_half_float_linear = true;
may_enable_chromium_color_buffer_float = true;
} else {
- if (extensions.Contains("GL_OES_texture_float")) {
+ if (is_es3 || extensions.Contains("GL_OES_texture_float")) {
enable_texture_float = true;
if (extensions.Contains("GL_OES_texture_float_linear")) {
enable_texture_float_linear = true;
@@ -470,9 +468,9 @@ void FeatureInfo::InitializeFeatures() {
may_enable_chromium_color_buffer_float = true;
}
}
- if (extensions.Contains("GL_OES_texture_half_float")) {
+ if (is_es3 || extensions.Contains("GL_OES_texture_half_float")) {
enable_texture_half_float = true;
- if (extensions.Contains("GL_OES_texture_half_float_linear")) {
+ if (is_es3 || extensions.Contains("GL_OES_texture_half_float_linear")) {
enable_texture_half_float_linear = true;
}
}
@@ -604,7 +602,7 @@ void FeatureInfo::InitializeFeatures() {
}
if (!workarounds_.disable_oes_standard_derivatives &&
- (extensions.Contains("GL_OES_standard_derivatives") ||
+ (is_es3 || extensions.Contains("GL_OES_standard_derivatives") ||
gfx::HasDesktopGLFeatures())) {
AddExtensionString("GL_OES_standard_derivatives");
feature_flags_.oes_standard_derivatives = true;
@@ -677,7 +675,6 @@ void FeatureInfo::InitializeFeatures() {
feature_flags_.enable_texture_float_linear |= enable_texture_float_linear;
feature_flags_.enable_texture_half_float_linear |=
enable_texture_half_float_linear;
- feature_flags_.npot_ok |= npot_ok;
if (extensions.Contains("GL_ANGLE_pack_reverse_row_order")) {
AddExtensionString("GL_ANGLE_pack_reverse_row_order");
@@ -756,8 +753,9 @@ void FeatureInfo::InitializeFeatures() {
GLint max_color_attachments = 0;
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_color_attachments);
- for (GLenum i = GL_COLOR_ATTACHMENT1_EXT;
- i < static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + max_color_attachments);
+ for (GLenum i = GL_COLOR_ATTACHMENT0_EXT;
piman 2014/08/28 18:17:39 nit: GL_COLOR_ATTACHMENT0_EXT is already in valida
+ i < static_cast<GLenum>(GL_COLOR_ATTACHMENT0_EXT +
+ max_color_attachments);
++i) {
validators_.attachment.AddValue(i);
}
@@ -773,13 +771,14 @@ void FeatureInfo::InitializeFeatures() {
}
}
- if (extensions.Contains("GL_EXT_blend_minmax") ||
+ if (is_es3 || extensions.Contains("GL_EXT_blend_minmax") ||
gfx::HasDesktopGLFeatures()) {
AddExtensionString("GL_EXT_blend_minmax");
validators_.equation.AddValue(GL_MIN_EXT);
validators_.equation.AddValue(GL_MAX_EXT);
}
+ // TODO(dshwang): GLES3 supports gl_FragDepth, not gl_FragDepthEXT.
if (extensions.Contains("GL_EXT_frag_depth") || gfx::HasDesktopGLFeatures()) {
AddExtensionString("GL_EXT_frag_depth");
feature_flags_.ext_frag_depth = true;
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698