diff options
author | Lionel Landwerlin <lionel.g.landwerlin@intel.com> | 2019-11-01 19:43:00 +0200 |
---|---|---|
committer | Lionel Landwerlin <lionel.g.landwerlin@intel.com> | 2019-11-02 09:14:26 +0000 |
commit | 88d665830f27087cb2188e03b0b734acc144c593 (patch) | |
tree | bf8f7869dd5228de8b9197e91fe0d73e4084430e | |
parent | 103378f3327ffd23a87dde6f1b190881004333de (diff) |
mesa: check draw buffer completeness on glClearBufferfi/glClearBufferiv
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r-- | src/mesa/main/clear.c | 12 |
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) |