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

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: test bots 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/framebuffer_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e77a1c0c605a6c79190f548a60d807fed8efb29a 100644
--- a/gpu/command_buffer/service/framebuffer_manager.cc
+++ b/gpu/command_buffer/service/framebuffer_manager.cc
@@ -106,7 +106,7 @@ class RenderbufferAttachment
attachment_type, max_color_attachments);
DCHECK_NE(0u, need);
uint32_t have = GLES2Util::GetChannelsForFormat(internal_format());
- if (context_type == CONTEXT_TYPE_WEBGL1 &&
+ if (0 && context_type == CONTEXT_TYPE_WEBGL1 &&
DetectWebGL1DepthStencilAttachmentConflicts(need, have))
return false;
return (need & have) != 0;
@@ -268,7 +268,7 @@ class TextureAttachment
internal_format == GL_LUMINANCE_ALPHA) {
return false;
}
- if (context_type == CONTEXT_TYPE_WEBGL1 &&
+ if (0 && context_type == CONTEXT_TYPE_WEBGL1 &&
DetectWebGL1DepthStencilAttachmentConflicts(need, have))
return need == have;
return (need & have) != 0;
@@ -401,6 +401,7 @@ Framebuffer::~Framebuffer() {
bool Framebuffer::HasUnclearedAttachment(
GLenum attachment) const {
+ DCHECK(attachment != GL_DEPTH_STENCIL_ATTACHMENT);
AttachmentMap::const_iterator it =
attachments_.find(attachment);
if (it != attachments_.end()) {
@@ -564,6 +565,7 @@ void Framebuffer::MarkAttachmentAsCleared(
TextureManager* texture_manager,
GLenum attachment,
bool cleared) {
+ DCHECK(attachment != GL_DEPTH_STENCIL_ATTACHMENT);
AttachmentMap::iterator it = attachments_.find(attachment);
if (it != attachments_.end()) {
Attachment* a = it->second.get();
@@ -581,6 +583,7 @@ void Framebuffer::MarkAttachmentsAsCleared(
bool cleared) {
for (AttachmentMap::iterator it = attachments_.begin();
it != attachments_.end(); ++it) {
+ DCHECK(it->first != GL_DEPTH_STENCIL_ATTACHMENT);
Attachment* attachment = it->second.get();
if (attachment->cleared() != cleared) {
attachment->SetCleared(renderbuffer_manager, texture_manager, cleared);
@@ -593,13 +596,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 +640,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 +649,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 +909,7 @@ void Framebuffer::DoUnbindGLAttachmentsForWorkaround(GLenum target) {
void Framebuffer::AttachRenderbuffer(
GLenum attachment, Renderbuffer* renderbuffer) {
+ DCHECK(attachment != GL_DEPTH_STENCIL_ATTACHMENT);
const Attachment* a = GetAttachment(attachment);
if (a)
a->DetachFromFramebuffer(this);
@@ -927,6 +925,7 @@ void Framebuffer::AttachRenderbuffer(
void Framebuffer::AttachTexture(
GLenum attachment, TextureRef* texture_ref, GLenum target,
GLint level, GLsizei samples) {
+ DCHECK(attachment != GL_DEPTH_STENCIL_ATTACHMENT);
const Attachment* a = GetAttachment(attachment);
if (a)
a->DetachFromFramebuffer(this);
@@ -943,6 +942,7 @@ void Framebuffer::AttachTexture(
void Framebuffer::AttachTextureLayer(
GLenum attachment, TextureRef* texture_ref, GLenum target,
GLint level, GLint layer) {
+ DCHECK(attachment != GL_DEPTH_STENCIL_ATTACHMENT);
const Attachment* a = GetAttachment(attachment);
if (a)
a->DetachFromFramebuffer(this);
« no previous file with comments | « no previous file | gpu/command_buffer/service/framebuffer_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698