| 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..4f1fae28ddbbef0f2a28a74acf1681571f31a2fb 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) OVERRIDE {
|
| uint32 need = GLES2Util::GetChannelsNeededForAttachmentType(
|
| attachment_type, max_color_attachments);
|
| uint32 have = GLES2Util::GetChannelsForFormat(internal_format());
|
| @@ -216,7 +217,8 @@ class TextureAttachment
|
| }
|
|
|
| virtual bool ValidForAttachmentType(
|
| - GLenum attachment_type, uint32 max_color_attachments) OVERRIDE {
|
| + GLenum attachment_type, uint32 max_color_attachments,
|
| + bool allow_float_color_attachment) OVERRIDE {
|
| GLenum type = 0;
|
| GLenum internal_format = 0;
|
| if (!texture_ref_->texture()->GetLevelType(
|
| @@ -233,6 +235,11 @@ class TextureAttachment
|
| internal_format == GL_LUMINANCE_ALPHA) {
|
| return false;
|
| }
|
| + if (type == GL_FLOAT &&
|
| + (!allow_float_color_attachment ||
|
| + (internal_format != GL_RGBA32F && internal_format != GL_RGB32F))) {
|
| + return false;
|
| + }
|
| return (need & have) != 0;
|
| }
|
|
|
| @@ -406,7 +413,8 @@ GLenum Framebuffer::GetColorAttachmentTextureType() const {
|
| return attachment->texture_type();
|
| }
|
|
|
| -GLenum Framebuffer::IsPossiblyComplete() const {
|
| +GLenum Framebuffer::IsPossiblyComplete(
|
| + bool allow_float_color_attachment) const {
|
| if (attachments_.empty()) {
|
| return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
|
| }
|
| @@ -418,7 +426,8 @@ 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_color_attachment)) {
|
| return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
|
| }
|
| if (width < 0) {
|
|
|