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 9a1b77cdfce90133e57274917bf9f482962c87d8..dc2a87e48925be7e79a16e86df3264f04d0a1871 100644 |
--- a/gpu/command_buffer/service/framebuffer_manager.cc |
+++ b/gpu/command_buffer/service/framebuffer_manager.cc |
@@ -76,6 +76,10 @@ class RenderbufferAttachment |
return renderbuffer_.get() == renderbuffer; |
} |
+ bool IsAttachmentComplete(FeatureInfo* feature_info) const override { |
+ return true; |
+ } |
+ |
bool CanRenderTo() const override { return true; } |
void DetachFromFramebuffer(Framebuffer* framebuffer) const override { |
@@ -190,6 +194,10 @@ class TextureAttachment |
return texture_ref_.get(); |
} |
+ bool IsAttachmentComplete(FeatureInfo* feature_info) const override { |
+ return texture_ref_->texture()->IsTextureComplete(feature_info); |
+ } |
+ |
bool CanRenderTo() const override { |
return texture_ref_->texture()->CanRenderTo(); |
} |
@@ -462,7 +470,8 @@ GLenum Framebuffer::GetReadBufferTextureType() const { |
return attachment->texture_type(); |
} |
-GLenum Framebuffer::IsPossiblyComplete() const { |
+GLenum Framebuffer::IsPossiblyComplete(GLenum target, |
+ FeatureInfo* feature_info) const { |
if (attachments_.empty()) { |
return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; |
} |
@@ -491,9 +500,14 @@ GLenum Framebuffer::IsPossiblyComplete() const { |
} |
} |
- if (!attachment->CanRenderTo()) { |
+ if (target != GL_READ_FRAMEBUFFER_EXT && !attachment->CanRenderTo()) { |
return GL_FRAMEBUFFER_UNSUPPORTED; |
} |
+ |
+ // See section 4.4.4 of the GLES3 spec. |
+ if (!attachment->IsAttachmentComplete(feature_info)) { |
+ return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; |
+ } |
} |
// This does not mean the framebuffer is actually complete. It just means our |