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/framebuffer_manager.cc

Issue 2496813002: [Command buffer] workaround the framebuffer completeness bug for Intel Mac (Closed)
Patch Set: code refactoring per zmo@'s suggestion: move read/draw buffer adjustment into CheckBound{Read|Draw}FramebufferValid Created 4 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/framebuffer_manager.cc
diff --git a/gpu/command_buffer/service/framebuffer_manager.cc b/gpu/command_buffer/service/framebuffer_manager.cc
index 0fd59c5fd6ba1dfb618709f97b1a8269481fd6d2..44f3c21b552f90acd9436a63a40044fac7b8af19 100644
--- a/gpu/command_buffer/service/framebuffer_manager.cc
+++ b/gpu/command_buffer/service/framebuffer_manager.cc
@@ -611,6 +611,43 @@ bool Framebuffer::HasStencilAttachment() const {
return attachments_.find(GL_STENCIL_ATTACHMENT) != attachments_.end();
}
+bool Framebuffer::ReadBufferHasNoImage() const {
+ if (read_buffer_ == GL_NONE) {
+ return false;
+ }
+ AttachmentMap::const_iterator it = attachments_.find(read_buffer_);
+ return it == attachments_.end();
+}
+
+bool Framebuffer::DrawBuffersHaveMissingImage(GLsizei* num, GLenum* buf) const {
+ DCHECK(num);
+ DCHECK(buf);
+ bool ret = false;
+ for (GLenum i = 0; i < manager_->max_draw_buffers_; ++i) {
+ if (draw_buffers_[i] == GL_NONE) {
+ buf[i] = GL_NONE;
+ continue;
+ }
+ const Attachment* attachment = GetAttachment(draw_buffers_[i]);
+ if (attachment) {
+ buf[i] = GL_COLOR_ATTACHMENT0 + i;
+ ++(*num);
+ } else {
+ buf[i] = GL_NONE;
+ ret = true;
+ }
+ }
+ return ret;
+}
+
+bool Framebuffer::ColorBuffersHaveImage() const {
+ for (GLenum i = 0; i < manager_->max_color_attachments_; i++) {
Zhenyao Mo 2016/11/16 03:27:27 Can you do the other way? i.e., go through attachm
Zhenyao Mo 2016/11/16 03:27:27 nit: ++i
+ if (attachments_.find(GL_COLOR_ATTACHMENT0 + i) != attachments_.end())
+ return true;
+ }
+ return false;
+}
+
GLenum Framebuffer::GetReadBufferInternalFormat() const {
if (read_buffer_ == GL_NONE)
return 0;

Powered by Google App Engine
This is Rietveld 408576698