diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c index fda4df59528..ca0ecd95b8c 100644 --- a/src/mesa/main/clear.c +++ b/src/mesa/main/clear.c @@ -467,6 +467,12 @@ clear_bufferuiv(struct gl_context *ctx, GLenum buffer, GLint drawbuffer, _mesa_update_state( ctx ); } + if (!no_error && ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE) { + _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION, + "glClearBufferuiv(incomplete framebuffer)"); + return; + } + switch (buffer) { case GL_COLOR: { @@ -555,6 +561,12 @@ clear_bufferfv(struct gl_context *ctx, GLenum buffer, GLint drawbuffer, _mesa_update_state( ctx ); } + if (!no_error && ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE) { + _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION, + "glClearBufferfv(incomplete framebuffer)"); + return; + } + switch (buffer) { case GL_DEPTH: /* Page 264 (page 280 of the PDF) of the OpenGL 3.0 spec says: