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

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

Issue 1283303002: gpu: FBO must be incomplete if the attached texture is not cube complete. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Depend on https://codereview.chromium.org/1299683002 Created 5 years, 4 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 | « gpu/command_buffer/service/framebuffer_manager.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | 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 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
« no previous file with comments | « gpu/command_buffer/service/framebuffer_manager.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698