radeonsi: Update buffer for other planes in si_alloc_resource

The buffer is shared with all planes, so it needs to be updated
in all other planes. This is already done in si_texture_create_object
when creating the buffer, but it was missing when reallocating
in si_texture_invalidate_storage.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11155
Cc: mesa-stable
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29216>
(cherry picked from commit c522848d5a)
This commit is contained in:
David Rosca 2024-05-15 12:59:42 +02:00 committed by Eric Engestrom
parent 1bf184747e
commit 331d440811
2 changed files with 10 additions and 1 deletions

View file

@ -1014,7 +1014,7 @@
"description": "radeonsi: Update buffer for other planes in si_alloc_resource",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -176,6 +176,15 @@ bool si_alloc_resource(struct si_screen *sscreen, struct si_resource *res)
util_range_set_empty(&res->valid_buffer_range);
res->TC_L2_dirty = false;
if (res->b.b.target != PIPE_BUFFER && !(res->b.b.flags & SI_RESOURCE_AUX_PLANE)) {
/* The buffer is shared with other planes. */
struct si_resource *plane = (struct si_resource *)res->b.b.next;
for (; plane; plane = (struct si_resource *)plane->b.b.next) {
radeon_bo_reference(sscreen->ws, &plane->buf, res->buf);
plane->gpu_address = res->gpu_address;
}
}
/* Print debug information. */
if (sscreen->debug_flags & DBG(VM) && res->b.b.target == PIPE_BUFFER) {
fprintf(stderr, "VM start=0x%" PRIX64 " end=0x%" PRIX64 " | Buffer %" PRIu64 " bytes | Flags: ",