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

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

Issue 72173002: gpu: Support ES3 msaa and depth/stencil formats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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
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 9329bc590fb67512cd2b6513553bb17f450efb5a..c5d16ab70631ed4d1f7dd36cd25cf0e3436f5a1d 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -100,11 +100,13 @@ void StringToWorkarounds(
FeatureInfo::FeatureFlags::FeatureFlags()
: chromium_framebuffer_multisample(false),
+ core_framebuffer_multisample(false),
multisampled_render_to_texture(false),
use_img_for_multisampled_render_to_texture(false),
oes_standard_derivatives(false),
oes_egl_image_external(false),
oes_depth24(false),
+ packed_depth24_stencil8(false),
npot_ok(false),
enable_texture_float_linear(false),
enable_texture_half_float_linear(false),
@@ -205,6 +207,13 @@ void FeatureInfo::InitializeFeatures() {
bool npot_ok = false;
+ bool is_es3 = false;
+ const char* str = reinterpret_cast<const char*>(glGetString(GL_VERSION));
+ if (str) {
+ std::string lstr(StringToLowerASCII(std::string(str)));
+ is_es3 = (lstr.substr(0, 12) == "opengl es 3.");
Ken Russell (switch to Gerrit) 2013/11/14 01:18:37 Is this going to scale well to some hypothetical O
Sami 2013/11/14 15:48:53 You could also check for glGetIntegerv({MAJOR_VERS
+ }
+
AddExtensionString("GL_ANGLE_translated_shader_source");
AddExtensionString("GL_CHROMIUM_async_pixel_transfers");
AddExtensionString("GL_CHROMIUM_bind_uniform_location");
@@ -312,7 +321,7 @@ void FeatureInfo::InitializeFeatures() {
if (!workarounds_.disable_depth_texture &&
(extensions.Contains("GL_ARB_depth_texture") ||
extensions.Contains("GL_OES_depth_texture") ||
- extensions.Contains("GL_ANGLE_depth_texture"))) {
+ extensions.Contains("GL_ANGLE_depth_texture") || is_es3)) {
enable_depth_texture = true;
}
@@ -328,11 +337,12 @@ void FeatureInfo::InitializeFeatures() {
}
if (extensions.Contains("GL_EXT_packed_depth_stencil") ||
- extensions.Contains("GL_OES_packed_depth_stencil")) {
+ extensions.Contains("GL_OES_packed_depth_stencil") || is_es3) {
AddExtensionString("GL_OES_packed_depth_stencil");
+ feature_flags_.packed_depth24_stencil8 = true;
if (enable_depth_texture) {
- texture_format_validators_[GL_DEPTH_STENCIL].AddValue(
- GL_UNSIGNED_INT_24_8);
+ texture_format_validators_[GL_DEPTH_STENCIL]
+ .AddValue(GL_UNSIGNED_INT_24_8);
validators_.texture_internal_format.AddValue(GL_DEPTH_STENCIL);
validators_.texture_format.AddValue(GL_DEPTH_STENCIL);
validators_.pixel_type.AddValue(GL_UNSIGNED_INT_24_8);
@@ -470,13 +480,15 @@ void FeatureInfo::InitializeFeatures() {
}
// Check for multisample support
- if (!disallowed_features_.multisampling) {
+ if (!disallowed_features_.multisampling &&
+ !workarounds_.disable_framebuffer_multisample) {
bool ext_has_multisample =
- extensions.Contains("GL_EXT_framebuffer_multisample");
+ extensions.Contains("GL_EXT_framebuffer_multisample") || is_es3;
if (!workarounds_.disable_angle_framebuffer_multisample) {
ext_has_multisample |=
extensions.Contains("GL_ANGLE_framebuffer_multisample");
}
+ feature_flags_.core_framebuffer_multisample = is_es3;
if (ext_has_multisample) {
feature_flags_.chromium_framebuffer_multisample = true;
validators_.frame_buffer_target.AddValue(GL_READ_FRAMEBUFFER_EXT);
@@ -503,7 +515,8 @@ void FeatureInfo::InitializeFeatures() {
}
}
- if (extensions.Contains("GL_OES_depth24") || gfx::HasDesktopGLFeatures()) {
+ if (extensions.Contains("GL_OES_depth24") || gfx::HasDesktopGLFeatures() ||
+ is_es3) {
AddExtensionString("GL_OES_depth24");
feature_flags_.oes_depth24 = true;
validators_.render_buffer_format.AddValue(GL_DEPTH_COMPONENT24);
@@ -663,13 +676,6 @@ void FeatureInfo::InitializeFeatures() {
if (!disallowed_features_.swap_buffer_complete_callback)
AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback");
- bool is_es3 = false;
- const char* str = reinterpret_cast<const char*>(glGetString(GL_VERSION));
- if (str) {
- std::string lstr(StringToLowerASCII(std::string(str)));
- is_es3 = (lstr.substr(0, 12) == "opengl es 3.");
- }
-
bool ui_gl_fence_works = extensions.Contains("GL_NV_fence") ||
extensions.Contains("GL_ARB_sync") ||
extensions.Contains("EGL_KHR_fence_sync");

Powered by Google App Engine
This is Rietveld 408576698