diff options
author | Lionel Landwerlin <lionel.g.landwerlin@intel.com> | 2019-11-11 12:32:50 +0200 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-11-13 10:34:47 -0800 |
commit | 330d31f63b1bded0d20c01d337fbd53ca776e503 (patch) | |
tree | f82ab0ba1d3316fd90c9eb1732f20302f9d762c3 | |
parent | 019dbc4b3b4d3758d978d81f0c2b9f299fa2e47e (diff) |
mesa: check framebuffer completeness only after state update
The change made in 88d665830f27 ("mesa: check draw buffer completeness
on glClearBufferfi/glClearBufferiv") correctly updated the state prior
to checking the framebuffer completeness on glClearBufferiv but not in
glClearBufferfi.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Fixes: 88d665830f27 ("mesa: check draw buffer completeness on glClearBufferfi/glClearBufferiv")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2072
(cherry picked from commit f93bb903020bac21a36e240b2c19a4733c2405ee)
-rw-r--r-- | src/mesa/main/clear.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c index 14d548d3689..013043f9f49 100644 --- a/src/mesa/main/clear.c +++ b/src/mesa/main/clear.c @@ -692,12 +692,6 @@ 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) @@ -707,6 +701,12 @@ clear_bufferfi(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, + "glClearBufferfi(incomplete framebuffer)"); + return; + } + if (ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer) mask |= BUFFER_BIT_DEPTH; if (ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Renderbuffer) |