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..6f2500e14fc4b300434381e4dd717f8c9996de67 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,14 @@ class TextureAttachment |
internal_format == GL_LUMINANCE_ALPHA) { |
return false; |
} |
+ 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 && |
+ internal_format != GL_RGBA32F && internal_format != GL_RGB32F)) { |
+ return false; |
Ken Russell (switch to Gerrit)
2014/02/11 00:37:23
I'm pretty sure this is going to break ANGLE's abi
oetuaho-nv
2014/02/11 12:42:16
Right, I should have realized that ANGLE doesn't f
|
+ } |
return (need & have) != 0; |
} |
@@ -406,7 +417,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 +429,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) { |