| 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 0c5d96708e856d8e9c3d8578eb785c9f2d18c71e..6651973585c2efbc87f104b0e3deb1ddc379ce79 100644
|
| --- a/gpu/command_buffer/service/framebuffer_manager.cc
|
| +++ b/gpu/command_buffer/service/framebuffer_manager.cc
|
| @@ -377,8 +377,12 @@ Framebuffer::Framebuffer(
|
| DCHECK_GT(manager->max_draw_buffers_, 0u);
|
| draw_buffers_.reset(new GLenum[manager->max_draw_buffers_]);
|
| draw_buffers_[0] = GL_COLOR_ATTACHMENT0;
|
| - for (uint32_t i = 1; i < manager->max_draw_buffers_; ++i)
|
| - draw_buffers_[i] = GL_NONE;
|
| + for (uint32_t ii = 1; ii < manager->max_draw_buffers_; ++ii) {
|
| + draw_buffers_[ii] = GL_NONE;
|
| + }
|
| +
|
| + color_attachment_base_types_.resize(manager->max_draw_buffers_);
|
| + ResetColorAttachmentBaseTypes();
|
| }
|
|
|
| Framebuffer::~Framebuffer() {
|
| @@ -392,6 +396,12 @@ Framebuffer::~Framebuffer() {
|
| }
|
| }
|
|
|
| +void Framebuffer::ResetColorAttachmentBaseTypes() {
|
| + for (size_t ii = 1; ii < color_attachment_base_types_.size(); ++ii) {
|
| + color_attachment_base_types_[ii] = SHADER_VARIABLE_UNDEFINED_TYPE;
|
| + }
|
| +}
|
| +
|
| bool Framebuffer::HasUnclearedAttachment(
|
| GLenum attachment) const {
|
| AttachmentMap::const_iterator it =
|
| @@ -500,7 +510,7 @@ bool Framebuffer::PrepareDrawBuffersForClear() const {
|
| return different;
|
| }
|
|
|
| -void Framebuffer::RestoreDrawBuffersAfterClear() const {
|
| +void Framebuffer::RestoreDrawBuffers() const {
|
| glDrawBuffersARB(manager_->max_draw_buffers_, draw_buffers_.get());
|
| }
|
|
|
| @@ -818,6 +828,27 @@ void Framebuffer::UnbindTexture(
|
| } while (!done);
|
| }
|
|
|
| +void Framebuffer::UpdateColorAttachmentBaseTypes() {
|
| + ResetColorAttachmentBaseTypes();
|
| + for (AttachmentMap::const_iterator it = attachments_.begin();
|
| + it != attachments_.end(); ++it) {
|
| + if (it->first < GL_COLOR_ATTACHMENT0 ||
|
| + it->first >= GL_COLOR_ATTACHMENT0 + manager_->max_draw_buffers_) {
|
| + continue;
|
| + }
|
| + size_t index = it->first - GL_COLOR_ATTACHMENT0;
|
| + Attachment* attachment = it->second.get();
|
| + GLenum internal_format = attachment->internal_format();
|
| + if (GLES2Util::IsSignedIntegerFormat(internal_format)) {
|
| + color_attachment_base_types_[index] = SHADER_VARIABLE_INT;
|
| + } else if (GLES2Util::IsUnsignedIntegerFormat(internal_format)) {
|
| + color_attachment_base_types_[index] = SHADER_VARIABLE_UINT;
|
| + } else {
|
| + color_attachment_base_types_[index] = SHADER_VARIABLE_FLOAT;
|
| + }
|
| + }
|
| +}
|
| +
|
| Framebuffer* FramebufferManager::GetFramebuffer(
|
| GLuint client_id) {
|
| FramebufferMap::iterator it = framebuffers_.find(client_id);
|
|
|