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

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: Use IsSameAttachment and update related unittests 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
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 84a77d46e74d5175c74c392eca676f0a5cab0ca0..f3e2fdd78bce809d0290292a6b1d339a4293f518 100644
--- a/gpu/command_buffer/service/framebuffer_manager.cc
+++ b/gpu/command_buffer/service/framebuffer_manager.cc
@@ -747,6 +747,20 @@ GLenum Framebuffer::IsPossiblyComplete(const FeatureInfo* feature_info) const {
}
}
+ // Binding different images to depth and stencil attachment points should
+ // return FRAMEBUFFER_UNSUPPORTED.
+ AttachmentMap::const_iterator depth_it = attachments_.find(
qiankun 2016/07/21 09:29:21 You can use GetAttachment() to get pointer of an a
+ GL_DEPTH_ATTACHMENT);
+ AttachmentMap::const_iterator stencil_it = attachments_.find(
+ GL_STENCIL_ATTACHMENT);
+ if (depth_it != attachments_.end() && stencil_it != attachments_.end()) {
+ Attachment *depth_attachment = depth_it->second.get();
+ Attachment *stencil_attachment = stencil_it->second.get();
+ if (!depth_attachment->IsSameAttachment(stencil_attachment)) {
+ return GL_FRAMEBUFFER_UNSUPPORTED;
+ }
+ }
+
// This does not mean the framebuffer is actually complete. It just means our
// checks passed.
return GL_FRAMEBUFFER_COMPLETE;

Powered by Google App Engine
This is Rietveld 408576698