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

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

Issue 2347063002: Fix crash in DoBlitFramebufferCHROMIUM (Closed)
Patch Set: Created 4 years, 3 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/gles2_cmd_decoder_unittest_framebuffers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 6feca3d1ca16ab4b7fe237edfe41ca08b8a59176..771650b2e8702d9942fd52ff6ff3c818f6b192be 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -7567,25 +7567,27 @@ void GLES2DecoderImpl::DoBlitFramebufferCHROMIUM(
is_feedback_loop = FeedbackLoopTrue;
} else if (!read_framebuffer || !draw_framebuffer) {
is_feedback_loop = FeedbackLoopFalse;
- }
- if ((mask & GL_DEPTH_BUFFER_BIT) != 0) {
- const Framebuffer::Attachment* depth_buffer_read =
- read_framebuffer->GetAttachment(GL_DEPTH_ATTACHMENT);
- const Framebuffer::Attachment* depth_buffer_draw =
- draw_framebuffer->GetAttachment(GL_DEPTH_ATTACHMENT);
- if (depth_buffer_draw &&
- depth_buffer_draw->IsSameAttachment(depth_buffer_read)) {
- is_feedback_loop = FeedbackLoopTrue;
+ } else {
+ DCHECK(read_framebuffer && draw_framebuffer);
+ if ((mask & GL_DEPTH_BUFFER_BIT) != 0) {
+ const Framebuffer::Attachment* depth_buffer_read =
+ read_framebuffer->GetAttachment(GL_DEPTH_ATTACHMENT);
+ const Framebuffer::Attachment* depth_buffer_draw =
+ draw_framebuffer->GetAttachment(GL_DEPTH_ATTACHMENT);
+ if (depth_buffer_draw &&
+ depth_buffer_draw->IsSameAttachment(depth_buffer_read)) {
+ is_feedback_loop = FeedbackLoopTrue;
+ }
}
- }
- if ((mask & GL_STENCIL_BUFFER_BIT) != 0) {
- const Framebuffer::Attachment* stencil_buffer_read =
- read_framebuffer->GetAttachment(GL_STENCIL_ATTACHMENT);
- const Framebuffer::Attachment* stencil_buffer_draw =
- draw_framebuffer->GetAttachment(GL_STENCIL_ATTACHMENT);
- if (stencil_buffer_draw &&
- stencil_buffer_draw->IsSameAttachment(stencil_buffer_read)) {
- is_feedback_loop = FeedbackLoopTrue;
+ if ((mask & GL_STENCIL_BUFFER_BIT) != 0) {
+ const Framebuffer::Attachment* stencil_buffer_read =
+ read_framebuffer->GetAttachment(GL_STENCIL_ATTACHMENT);
+ const Framebuffer::Attachment* stencil_buffer_draw =
+ draw_framebuffer->GetAttachment(GL_STENCIL_ATTACHMENT);
+ if (stencil_buffer_draw &&
+ stencil_buffer_draw->IsSameAttachment(stencil_buffer_read)) {
+ is_feedback_loop = FeedbackLoopTrue;
+ }
}
}
@@ -7605,6 +7607,7 @@ void GLES2DecoderImpl::DoBlitFramebufferCHROMIUM(
GLenum src_sized_format =
GLES2Util::ConvertToSizedFormat(src_format, src_type);
+ DCHECK(read_framebuffer || (is_feedback_loop != FeedbackLoopUnknown));
const Framebuffer::Attachment* read_buffer =
is_feedback_loop == FeedbackLoopUnknown ?
read_framebuffer->GetReadBufferAttachment() : nullptr;
@@ -7633,6 +7636,7 @@ void GLES2DecoderImpl::DoBlitFramebufferCHROMIUM(
// Check whether draw buffers have identical color image with read buffer
if (is_feedback_loop == FeedbackLoopUnknown) {
GLenum attachment = static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + ii);
+ DCHECK(draw_framebuffer);
const Framebuffer::Attachment* draw_buffer =
draw_framebuffer->GetAttachment(attachment);
if (!draw_buffer) {
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698