Index: gpu/command_buffer/service/framebuffer_manager.cc |
diff --git a/gpu/command_buffer/service/framebuffer_manager.cc b/gpu/command_buffer/service/framebuffer_manager.cc |
index 0c5d96708e856d8e9c3d8578eb785c9f2d18c71e..4e06605d34966f1d89d25553105a5608ae95c25d 100644 |
--- a/gpu/command_buffer/service/framebuffer_manager.cc |
+++ b/gpu/command_buffer/service/framebuffer_manager.cc |
@@ -677,6 +677,25 @@ GLenum Framebuffer::IsPossiblyComplete(const FeatureInfo* feature_info) const { |
} |
} |
+ // WebGL2 and GLES3 don't allow different images to bind to the depth and |
+ // stencil attachment points, or GL_FRAMEBUFFER_UNSUPPORTED is returned. |
+ if (feature_info->context_type() == CONTEXT_TYPE_WEBGL2 || |
+ feature_info->context_type() == CONTEXT_TYPE_OPENGLES3) { |
Zhenyao Mo
2016/07/20 13:46:07
We probably want to enforce this for all context t
|
+ AttachmentMap::const_iterator depth_it = |
+ attachments_.find(GL_DEPTH_ATTACHMENT); |
+ if (depth_it != attachments_.end()) { |
+ AttachmentMap::const_iterator stencil_it = |
+ attachments_.find(GL_STENCIL_ATTACHMENT); |
+ if (stencil_it != attachments_.end()) { |
+ if ((depth_it->second.get()->IsTextureAttachment() != |
Zhenyao Mo
2016/07/20 13:46:07
This is incorrect. First, you also need to consid
|
+ stencil_it->second.get()->IsTextureAttachment()) || |
+ (depth_it->second.get()->object_name() != |
+ stencil_it->second.get()->object_name())) { |
+ return GL_FRAMEBUFFER_UNSUPPORTED; |
+ } |
+ } |
+ } |
+ } |
// This does not mean the framebuffer is actually complete. It just means our |
// checks passed. |
return GL_FRAMEBUFFER_COMPLETE; |