mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
mesa: Don't try to clear a NULL renderbuffer
In an ES2 context (or if GL_ARB_ES2_compatibility) is supported, the framebuffer can be complete with some attachments be missing. In this case the _ColorDrawBuffers pointer will be NULL. Fixes the crash in piglit test fbo-missing-attachment-clear. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739 Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Eric Anholt <eric@anholt.net> NOTE: This is a candidate for the stable branches.
This commit is contained in:
parent
1d71bbed3b
commit
7f9c17aaa8
1 changed files with 8 additions and 0 deletions
|
|
@ -165,6 +165,14 @@ clear_color_buffers(struct gl_context *ctx)
|
|||
|
||||
for (buf = 0; buf < ctx->DrawBuffer->_NumColorDrawBuffers; buf++) {
|
||||
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[buf];
|
||||
|
||||
/* If this is an ES2 context or GL_ARB_ES2_compatibility is supported,
|
||||
* the framebuffer can be complete with some attachments be missing. In
|
||||
* this case the _ColorDrawBuffers pointer will be NULL.
|
||||
*/
|
||||
if (rb == NULL)
|
||||
continue;
|
||||
|
||||
if (ctx->Color.ColorMask[buf][0] == 0 ||
|
||||
ctx->Color.ColorMask[buf][1] == 0 ||
|
||||
ctx->Color.ColorMask[buf][2] == 0 ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue