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 48e503cb45b3d1e64986d369edfe70d7f3557c16..1e125fc3e53731bdda9e8d29eb96ce6adc2c1e66 100644 |
--- a/gpu/command_buffer/service/framebuffer_manager.cc |
+++ b/gpu/command_buffer/service/framebuffer_manager.cc |
@@ -102,7 +102,8 @@ class RenderbufferAttachment |
} |
virtual bool ValidForAttachmentType( |
- GLenum attachment_type, uint32 max_color_attachments) OVERRIDE { |
+ GLenum attachment_type, uint32 max_color_attachments, |
+ bool, bool) OVERRIDE { |
uint32 need = GLES2Util::GetChannelsNeededForAttachmentType( |
attachment_type, max_color_attachments); |
uint32 have = GLES2Util::GetChannelsForFormat(internal_format()); |
@@ -216,7 +217,9 @@ class TextureAttachment |
} |
virtual bool ValidForAttachmentType( |
- GLenum attachment_type, uint32 max_color_attachments) OVERRIDE { |
+ GLenum attachment_type, uint32 max_color_attachments, |
+ bool allow_float_rgba_color_attachment, |
+ bool allow_float_rgb_color_attachment) OVERRIDE { |
GLenum type = 0; |
GLenum internal_format = 0; |
if (!texture_ref_->texture()->GetLevelType( |
@@ -233,6 +236,14 @@ class TextureAttachment |
internal_format == GL_LUMINANCE_ALPHA) { |
return false; |
} |
+ if ((internal_format == GL_RGBA32F && |
+ !allow_float_rgba_color_attachment) || |
+ (internal_format == GL_RGB32F && |
+ !allow_float_rgb_color_attachment) || |
+ (type == GL_FLOAT && |
+ internal_format != GL_RGBA32F && internal_format != GL_RGB32F)) { |
+ return false; |
+ } |
return (need & have) != 0; |
} |
@@ -406,7 +417,9 @@ GLenum Framebuffer::GetColorAttachmentTextureType() const { |
return attachment->texture_type(); |
} |
-GLenum Framebuffer::IsPossiblyComplete() const { |
+GLenum Framebuffer::IsPossiblyComplete( |
+ bool allow_float_rgba_color_attachment, |
+ bool allow_float_rgb_color_attachment) const { |
if (attachments_.empty()) { |
return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; |
} |
@@ -418,7 +431,9 @@ GLenum Framebuffer::IsPossiblyComplete() const { |
GLenum attachment_type = it->first; |
Attachment* attachment = it->second.get(); |
if (!attachment->ValidForAttachmentType(attachment_type, |
- manager_->max_color_attachments_)) { |
+ manager_->max_color_attachments_, |
+ allow_float_rgba_color_attachment, |
+ allow_float_rgb_color_attachment)) { |
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; |
} |
if (width < 0) { |