mesa/st: Finalize the texture before BlitFramebuffer from it.

If the texture hasn't yet been validated, the current tex image contents
may have been ignored in favor of the texture's main miptree.  Fixes test
failure on softpipe and intermittent failures on radeonsi in:

https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/428

Cc: mesa-stable
Tested-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8091>
This commit is contained in:
Eric Anholt 2020-12-14 09:24:58 -08:00 committed by Marge Bot
parent 5f2166525f
commit f740af2796

View file

@ -39,6 +39,7 @@
#include "st_cb_bitmap.h"
#include "st_cb_blit.h"
#include "st_cb_fbo.h"
#include "st_cb_texture.h"
#include "st_manager.h"
#include "st_scissor.h"
#include "st_util.h"
@ -180,6 +181,12 @@ st_BlitFramebuffer(struct gl_context *ctx,
blit.mask = PIPE_MASK_RGBA;
if (srcAtt->Type == GL_TEXTURE) {
/* Make sure that the st_texture_object->pt is the current storage for
* our miplevel. The finalize would happen at some point anyway, might
* as well be now.
*/
st_finalize_texture(ctx, st->pipe, srcAtt->Texture, srcAtt->CubeMapFace);
struct st_texture_object *srcObj = st_texture_object(srcAtt->Texture);
if (!srcObj || !srcObj->pt) {