r600/sfn: clear PIPE_MAP_UNSYNCRONIZED for partial DS texture writes
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

When writing to a depth texture the driver is first doing a decompress
blit to a stageing resource. On one hand this blit can be skipped, if
PIPE_MAP_DISCARD_WHOLE_RESOURCE is set, OTOH we need to clear the
PIPE_MAP_UNSYNCHRONIZED flag if a partial write is done, because we have to
wait until the blit is finished.

v2: Update the patch with a more targeted approach.

Fixes: 25b97a3a96 ("mesa/st: mark internal texture map calls as UNSYNCHRONIZED")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13916

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37457>
This commit is contained in:
Gert Wollny 2025-09-18 15:28:34 +02:00 committed by Marge Bot
parent 59a4f53b95
commit 04f6e24e65

View file

@ -1381,10 +1381,16 @@ void *r600_texture_transfer_map(struct pipe_context *ctx,
return NULL;
}
rctx->blit_decompress_depth(ctx, rtex, staging_depth,
level, level,
box->z, box->z + box->depth - 1,
0, 0);
if (!(usage & PIPE_MAP_DISCARD_WHOLE_RESOURCE)) {
rctx->blit_decompress_depth(ctx, rtex, staging_depth,
level, level,
box->z, box->z + box->depth - 1,
0, 0);
/* Since we have to wait for the blit_decompress_depth to finish,
* we have to clear PIPE_MAP_UNSYNCHRONIZED here.
*/
usage &= ~PIPE_MAP_UNSYNCHRONIZED;
}
offset = r600_texture_get_offset(rctx->screen, staging_depth,
level, box,