asahi: do not stall for writers with invalid mips

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
This commit is contained in:
Alyssa Rosenzweig 2023-12-07 19:17:35 -04:00
parent 69e6606bf9
commit c9b2bf84e5

View file

@ -762,6 +762,13 @@ agx_prepare_for_map(struct agx_context *ctx, struct agx_resource *rsrc,
if (staging_blit)
return;
/* If the level has not been written, we may freely do CPU access (writes),
* even if other levels are being written by the GPU. This lets us write some
* mip levels on the CPU and some on the GPU, without stalling.
*/
if (!agx_resource_valid(rsrc, level))
return;
/* Upgrade DISCARD_RANGE to WHOLE_RESOURCE if the whole resource is
* being mapped.
*/