summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/clear.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index 9221c7287a3..c5d612f4a6c 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -350,6 +350,12 @@ clear_bufferiv(struct gl_context *ctx, GLenum buffer, GLint drawbuffer,
_mesa_update_state( ctx );
}
+ if (!no_error && ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glClearBufferiv(incomplete framebuffer)");
+ return;
+ }
+
switch (buffer) {
case GL_STENCIL:
/* Page 264 (page 280 of the PDF) of the OpenGL 3.0 spec says:
@@ -686,6 +692,12 @@ clear_bufferfi(struct gl_context *ctx, GLenum buffer, GLint drawbuffer,
drawbuffer);
return;
}
+
+ if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glClearBufferfi(incomplete framebuffer)");
+ return;
+ }
}
if (ctx->RasterDiscard)