Chromium Code Reviews| 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..455390147328629a23b4856f514e66db8b548f97 100644 |
| --- a/gpu/command_buffer/service/framebuffer_manager.cc |
| +++ b/gpu/command_buffer/service/framebuffer_manager.cc |
| @@ -6,6 +6,7 @@ |
| #include "base/logging.h" |
| #include "base/strings/stringprintf.h" |
| #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| +#include "gpu/command_buffer/service/feature_info.h" |
| #include "gpu/command_buffer/service/renderbuffer_manager.h" |
| #include "gpu/command_buffer/service/texture_manager.h" |
| #include "ui/gl/gl_bindings.h" |
| @@ -102,7 +103,8 @@ class RenderbufferAttachment |
| } |
| virtual bool ValidForAttachmentType( |
| - GLenum attachment_type, uint32 max_color_attachments) OVERRIDE { |
| + GLenum attachment_type, uint32 max_color_attachments, |
| + const FeatureInfo*) OVERRIDE { |
| uint32 need = GLES2Util::GetChannelsNeededForAttachmentType( |
| attachment_type, max_color_attachments); |
| uint32 have = GLES2Util::GetChannelsForFormat(internal_format()); |
| @@ -216,7 +218,8 @@ class TextureAttachment |
| } |
| virtual bool ValidForAttachmentType( |
| - GLenum attachment_type, uint32 max_color_attachments) OVERRIDE { |
| + GLenum attachment_type, uint32 max_color_attachments, |
| + const FeatureInfo* feature_info) OVERRIDE { |
| GLenum type = 0; |
| GLenum internal_format = 0; |
| if (!texture_ref_->texture()->GetLevelType( |
| @@ -233,6 +236,18 @@ class TextureAttachment |
| internal_format == GL_LUMINANCE_ALPHA) { |
| return false; |
| } |
| + // As a workaround for ANGLE implementing rendering to float textures in |
| + // an unspecified way, accept all internalformats for float textures when |
| + // using ANGLE. Otherwise only allow rendering to float textures as exposed |
| + // by CHROMIUM_color_buffer_float_rgb(a). |
|
piman
2014/02/11 21:28:38
I don't think this is right.
When using ANGLE, we'
Ken Russell (switch to Gerrit)
2014/02/12 00:11:01
When running on ANGLE, the command buffer won't ex
|
| + if ((internal_format == GL_RGBA32F && |
| + !feature_info->feature_flags().chromium_color_buffer_float_rgba) || |
| + (internal_format == GL_RGB32F && |
| + !feature_info->feature_flags().chromium_color_buffer_float_rgb) || |
| + (type == GL_FLOAT && !feature_info->feature_flags().is_angle && |
| + internal_format != GL_RGBA32F && internal_format != GL_RGB32F)) { |
| + return false; |
| + } |
| return (need & have) != 0; |
| } |
| @@ -406,7 +421,7 @@ GLenum Framebuffer::GetColorAttachmentTextureType() const { |
| return attachment->texture_type(); |
| } |
| -GLenum Framebuffer::IsPossiblyComplete() const { |
| +GLenum Framebuffer::IsPossiblyComplete(const FeatureInfo* feature_info) const { |
| if (attachments_.empty()) { |
| return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; |
| } |
| @@ -418,7 +433,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_, |
| + feature_info)) { |
| return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; |
| } |
| if (width < 0) { |