asahi: flush before resource transition

otherwise data_valid is not valid! fixes arb_shader_image_load_store-bitcast
and who knows what else.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
This commit is contained in:
Alyssa Rosenzweig 2023-11-20 13:48:51 -04:00
parent e637ccff36
commit 9fc23df0d5

View file

@ -1179,6 +1179,12 @@ transition_resource(struct pipe_context *pctx, struct agx_resource *rsrc,
assert(new_res);
assert(!(rsrc->base.bind & PIPE_BIND_SHARED) && "cannot swap BOs if shared");
/* Flush current writers out, so that rsrc->data_valid is correctly set (e.g.
* for render targets). The writers would have been flushed by the blits
* anyway, so this is not further harming performance.
*/
agx_flush_writer(agx_context(pctx), rsrc, "Transition");
int level;
BITSET_FOREACH_SET(level, rsrc->data_valid, PIPE_MAX_TEXTURE_LEVELS) {
/* Blit each valid level */