From da7223ebdc82609a112aae24003bbdc154c170bf Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Fri, 8 Jul 2016 14:24:38 -0400 Subject: mesa: set _NEW_BUFFERS when updating texture bound to current buffers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a glTexImage call updates the parameters of a currently bound framebuffer, we might miss out on revalidating whether it is complete. Make sure to set _NEW_BUFFERS which will trigger the revalidation in that case. Also while we're at it, fix the fb parameter passed in to the eventual RenderTexture call. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94148 Signed-off-by: Ilia Mirkin Cc: "11.2 12.0" Reviewed-by: Marek Olšák Tested-by: Emmanuel Gil Peyrot --- src/mesa/main/teximage.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 81e46a170ae..080bcbf5509 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2606,10 +2606,16 @@ check_rtt_cb(GLuint key, void *data, void *userData) att->Texture == texObj && att->TextureLevel == level && att->CubeMapFace == face) { - _mesa_update_texture_renderbuffer(ctx, ctx->DrawBuffer, att); + _mesa_update_texture_renderbuffer(ctx, fb, att); assert(att->Renderbuffer->TexImage); /* Mark fb status as indeterminate to force re-validation */ fb->_Status = 0; + + /* Make sure that the revalidation actually happens if this is + * being done to currently-bound buffers. + */ + if (fb == ctx->DrawBuffer || fb == ctx->ReadBuffer) + ctx->NewState |= _NEW_BUFFERS; } } } -- cgit v1.2.3