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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 for (GLenum i = it->first + 1; | 755 for (GLenum i = it->first + 1; |
756 i < GL_COLOR_ATTACHMENT0 + manager_->max_color_attachments_; i++) { | 756 i < GL_COLOR_ATTACHMENT0 + manager_->max_color_attachments_; i++) { |
757 const Attachment* other = GetAttachment(i); | 757 const Attachment* other = GetAttachment(i); |
758 if (other && attachment->IsSameAttachment(other)) { | 758 if (other && attachment->IsSameAttachment(other)) { |
759 return GL_FRAMEBUFFER_UNSUPPORTED; | 759 return GL_FRAMEBUFFER_UNSUPPORTED; |
760 } | 760 } |
761 } | 761 } |
762 } | 762 } |
763 } | 763 } |
764 | 764 |
| 765 // Binding different images to depth and stencil attachment points should |
| 766 // return FRAMEBUFFER_UNSUPPORTED. |
| 767 const Attachment* depth_attachment = GetAttachment(GL_DEPTH_ATTACHMENT); |
| 768 const Attachment* stencil_attachment = GetAttachment(GL_STENCIL_ATTACHMENT); |
| 769 if (depth_attachment && stencil_attachment) { |
| 770 if (!depth_attachment->IsSameAttachment(stencil_attachment)) { |
| 771 return GL_FRAMEBUFFER_UNSUPPORTED; |
| 772 } |
| 773 } |
| 774 |
765 // This does not mean the framebuffer is actually complete. It just means our | 775 // This does not mean the framebuffer is actually complete. It just means our |
766 // checks passed. | 776 // checks passed. |
767 return GL_FRAMEBUFFER_COMPLETE; | 777 return GL_FRAMEBUFFER_COMPLETE; |
768 } | 778 } |
769 | 779 |
770 GLenum Framebuffer::GetStatus( | 780 GLenum Framebuffer::GetStatus( |
771 TextureManager* texture_manager, GLenum target) const { | 781 TextureManager* texture_manager, GLenum target) const { |
772 if (!manager_->GetFramebufferComboCompleteCache()) { | 782 if (!manager_->GetFramebufferComboCompleteCache()) { |
773 return glCheckFramebufferStatusEXT(target); | 783 return glCheckFramebufferStatusEXT(target); |
774 } | 784 } |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 | 1063 |
1054 bool FramebufferManager::IsComplete( | 1064 bool FramebufferManager::IsComplete( |
1055 Framebuffer* framebuffer) { | 1065 Framebuffer* framebuffer) { |
1056 DCHECK(framebuffer); | 1066 DCHECK(framebuffer); |
1057 return framebuffer->framebuffer_complete_state_count_id() == | 1067 return framebuffer->framebuffer_complete_state_count_id() == |
1058 framebuffer_state_change_count_; | 1068 framebuffer_state_change_count_; |
1059 } | 1069 } |
1060 | 1070 |
1061 } // namespace gles2 | 1071 } // namespace gles2 |
1062 } // namespace gpu | 1072 } // namespace gpu |
OLD | NEW |