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 cec5b104b7ab678b71a164d4da999293e99df8a8..75ae7f6c5d86a77bc0f6cad050722fd7c5a64253 100644 |
--- a/gpu/command_buffer/service/framebuffer_manager.cc |
+++ b/gpu/command_buffer/service/framebuffer_manager.cc |
@@ -593,13 +593,11 @@ bool Framebuffer::HasColorAttachment(int index) const { |
} |
bool Framebuffer::HasDepthAttachment() const { |
- return attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT) != attachments_.end() || |
- attachments_.find(GL_DEPTH_ATTACHMENT) != attachments_.end(); |
+ return attachments_.find(GL_DEPTH_ATTACHMENT) != attachments_.end(); |
} |
bool Framebuffer::HasStencilAttachment() const { |
- return attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT) != attachments_.end() || |
- attachments_.find(GL_STENCIL_ATTACHMENT) != attachments_.end(); |
+ return attachments_.find(GL_STENCIL_ATTACHMENT) != attachments_.end(); |
} |
GLenum Framebuffer::GetReadBufferInternalFormat() const { |
@@ -639,9 +637,7 @@ GLsizei Framebuffer::GetSamples() const { |
} |
GLenum Framebuffer::GetDepthFormat() const { |
- auto iter = attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT); |
- if (iter == attachments_.end()) |
- iter = attachments_.find(GL_DEPTH_ATTACHMENT); |
+ auto iter = attachments_.find(GL_DEPTH_ATTACHMENT); |
if (iter == attachments_.end()) |
return 0; |
Attachment* attachment = iter->second.get(); |
@@ -650,9 +646,7 @@ GLenum Framebuffer::GetDepthFormat() const { |
} |
GLenum Framebuffer::GetStencilFormat() const { |
- auto iter = attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT); |
- if (iter == attachments_.end()) |
- iter = attachments_.find(GL_STENCIL_ATTACHMENT); |
+ auto iter = attachments_.find(GL_STENCIL_ATTACHMENT); |
if (iter == attachments_.end()) |
return 0; |
Attachment* attachment = iter->second.get(); |
@@ -912,6 +906,7 @@ void Framebuffer::DoUnbindGLAttachmentsForWorkaround(GLenum target) { |
void Framebuffer::AttachRenderbuffer( |
GLenum attachment, Renderbuffer* renderbuffer) { |
+ DCHECK(attachment != GL_DEPTH_STENCIL_ATTACHMENT); |
Zhenyao Mo
2016/07/20 20:28:10
Also dcheck in texture side.
|
const Attachment* a = GetAttachment(attachment); |
if (a) |
a->DetachFromFramebuffer(this); |