diff options
author | Eric Anholt <eric@anholt.net> | 2020-12-14 09:24:58 -0800 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2020-12-18 09:35:23 -0800 |
commit | c00c8d8c91d8d3ca1194645e029510eace513183 (patch) | |
tree | 06ae2851094ef448e81b6056111863e97c5b48d7 | |
parent | 8232610da2dc2289950143718560afb28980c56e (diff) |
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>
(cherry picked from commit f740af27964ef148de94fd389edf736bb488bfd0)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_blit.c | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json index f26284ababa..ed8018c0893 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -283,7 +283,7 @@ "description": "mesa/st: Finalize the texture before BlitFramebuffer from it.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c index d91cc9623ac..cf55eff6e5c 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++ b/src/mesa/state_tracker/st_cb_blit.c @@ -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) { |