OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/framebuffer_manager.h" | 5 #include "gpu/command_buffer/service/framebuffer_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
740 for (GLenum i = it->first + 1; | 740 for (GLenum i = it->first + 1; |
741 i < GL_COLOR_ATTACHMENT0 + manager_->max_color_attachments_; i++) { | 741 i < GL_COLOR_ATTACHMENT0 + manager_->max_color_attachments_; i++) { |
742 const Attachment* other = GetAttachment(i); | 742 const Attachment* other = GetAttachment(i); |
743 if (other && attachment->IsSameAttachment(other)) { | 743 if (other && attachment->IsSameAttachment(other)) { |
744 return GL_FRAMEBUFFER_UNSUPPORTED; | 744 return GL_FRAMEBUFFER_UNSUPPORTED; |
745 } | 745 } |
746 } | 746 } |
747 } | 747 } |
748 } | 748 } |
749 | 749 |
750 // Binding different images to depth and stencil attachment points should | |
751 // return FRAMEBUFFER_UNSUPPORTED. | |
752 AttachmentMap::const_iterator depth_it = attachments_.find( | |
qiankun
2016/07/21 09:29:21
You can use GetAttachment() to get pointer of an a
| |
753 GL_DEPTH_ATTACHMENT); | |
754 AttachmentMap::const_iterator stencil_it = attachments_.find( | |
755 GL_STENCIL_ATTACHMENT); | |
756 if (depth_it != attachments_.end() && stencil_it != attachments_.end()) { | |
757 Attachment *depth_attachment = depth_it->second.get(); | |
758 Attachment *stencil_attachment = stencil_it->second.get(); | |
759 if (!depth_attachment->IsSameAttachment(stencil_attachment)) { | |
760 return GL_FRAMEBUFFER_UNSUPPORTED; | |
761 } | |
762 } | |
763 | |
750 // This does not mean the framebuffer is actually complete. It just means our | 764 // This does not mean the framebuffer is actually complete. It just means our |
751 // checks passed. | 765 // checks passed. |
752 return GL_FRAMEBUFFER_COMPLETE; | 766 return GL_FRAMEBUFFER_COMPLETE; |
753 } | 767 } |
754 | 768 |
755 GLenum Framebuffer::GetStatus( | 769 GLenum Framebuffer::GetStatus( |
756 TextureManager* texture_manager, GLenum target) const { | 770 TextureManager* texture_manager, GLenum target) const { |
757 if (!manager_->GetFramebufferComboCompleteCache()) { | 771 if (!manager_->GetFramebufferComboCompleteCache()) { |
758 return glCheckFramebufferStatusEXT(target); | 772 return glCheckFramebufferStatusEXT(target); |
759 } | 773 } |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1038 | 1052 |
1039 bool FramebufferManager::IsComplete( | 1053 bool FramebufferManager::IsComplete( |
1040 Framebuffer* framebuffer) { | 1054 Framebuffer* framebuffer) { |
1041 DCHECK(framebuffer); | 1055 DCHECK(framebuffer); |
1042 return framebuffer->framebuffer_complete_state_count_id() == | 1056 return framebuffer->framebuffer_complete_state_count_id() == |
1043 framebuffer_state_change_count_; | 1057 framebuffer_state_change_count_; |
1044 } | 1058 } |
1045 | 1059 |
1046 } // namespace gles2 | 1060 } // namespace gles2 |
1047 } // namespace gpu | 1061 } // namespace gpu |
OLD | NEW |