Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: gpu/command_buffer/service/framebuffer_manager.cc

Issue 2171543002: Split DEPTH_STENCIL into DEPTH and STENCIL in command buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698