zink: propagate valid buffer range to real buffer when mapping staging

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30107>
(cherry picked from commit fa210726b6)
This commit is contained in:
Mike Blumenkrantz 2024-06-25 11:48:13 -04:00 committed by Eric Engestrom
parent 92e59d71cd
commit 722a7f589d
2 changed files with 6 additions and 2 deletions

View file

@ -244,7 +244,7 @@
"description": "zink: propagate valid buffer range to real buffer when mapping staging",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -2432,9 +2432,13 @@ overwrite:
}
}
trans->base.b.usage = usage;
if (usage & PIPE_MAP_WRITE)
if (usage & PIPE_MAP_WRITE) {
util_range_add(&res->base.b, &res->valid_buffer_range, box->x, box->x + box->width);
struct zink_resource *orig_res = zink_resource(trans->base.b.resource);
util_range_add(&orig_res->base.b, &orig_res->valid_buffer_range, box->x, box->x + box->width);
}
success:
/* ensure the copy context gets unlocked */
if (ctx == screen->copy_context)