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

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

Issue 2351093002: Fix crash in BlitFramebufferCHROMIUM if a read or draw depth/stencil buffer is not present (Closed)
Patch Set: rebase 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
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 80bd8d98abe51ea7e40519c7434d5a5ee46e33f0..16021944bc216768e9985c796610fdefd8b1ff95 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -7595,24 +7595,28 @@ void GLES2DecoderImpl::DoBlitFramebufferCHROMIUM(
DCHECK(read_framebuffer && draw_framebuffer);
if ((mask & GL_DEPTH_BUFFER_BIT) != 0) {
const Framebuffer::Attachment* depth_buffer_read =
- read_framebuffer->GetAttachment(GL_DEPTH_ATTACHMENT);
+ read_framebuffer->GetDepthAttachment();
const Framebuffer::Attachment* depth_buffer_draw =
- draw_framebuffer->GetAttachment(GL_DEPTH_ATTACHMENT);
- if (depth_buffer_draw &&
- depth_buffer_draw->IsSameAttachment(depth_buffer_read)) {
+ draw_framebuffer->GetDepthAttachment();
+ if (!depth_buffer_draw || !depth_buffer_read) {
+ mask &= ~GL_DEPTH_BUFFER_BIT;
+ } else if (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);
+ read_framebuffer->GetStencilAttachment();
const Framebuffer::Attachment* stencil_buffer_draw =
- draw_framebuffer->GetAttachment(GL_STENCIL_ATTACHMENT);
- if (stencil_buffer_draw &&
- stencil_buffer_draw->IsSameAttachment(stencil_buffer_read)) {
+ draw_framebuffer->GetStencilAttachment();
+ if (!stencil_buffer_draw || !stencil_buffer_read) {
+ mask &= ~GL_STENCIL_BUFFER_BIT;
+ } else if (stencil_buffer_draw->IsSameAttachment(stencil_buffer_read)) {
is_feedback_loop = FeedbackLoopTrue;
}
}
+ if (!mask)
+ return;
}
GLenum src_internal_format = GetBoundReadFramebufferInternalFormat();
« no previous file with comments | « gpu/command_buffer/service/framebuffer_manager.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698