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

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

Issue 2161383002: Add check if depth and stencil attachments are same image (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add check if depth and stencil attachments are the same image when both attachments are present Created 4 years, 5 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 | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698