mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 06:10:13 +01:00
zink: only copy resource during add_bind if it is valid
this otherwise is a big no-op Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36010>
This commit is contained in:
parent
e59305c29f
commit
b022cdc8a1
1 changed files with 9 additions and 7 deletions
|
|
@ -1772,13 +1772,15 @@ add_resource_bind(struct zink_context *ctx, struct zink_resource *res, unsigned
|
|||
res->layout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
res->obj = new_obj;
|
||||
res->queue = VK_QUEUE_FAMILY_IGNORED;
|
||||
for (unsigned i = 0; i <= res->base.b.last_level; i++) {
|
||||
struct pipe_box box;
|
||||
u_box_3d(0, 0, 0,
|
||||
u_minify(res->base.b.width0, i),
|
||||
u_minify(res->base.b.height0, i), res->base.b.array_size, &box);
|
||||
box.depth = util_num_layers(&res->base.b, i);
|
||||
ctx->base.resource_copy_region(&ctx->base, &res->base.b, i, 0, 0, 0, &staging.base.b, i, &box);
|
||||
if (res->valid) {
|
||||
for (unsigned i = 0; i <= res->base.b.last_level; i++) {
|
||||
struct pipe_box box;
|
||||
u_box_3d(0, 0, 0,
|
||||
u_minify(res->base.b.width0, i),
|
||||
u_minify(res->base.b.height0, i), res->base.b.array_size, &box);
|
||||
box.depth = util_num_layers(&res->base.b, i);
|
||||
ctx->base.resource_copy_region(&ctx->base, &res->base.b, i, 0, 0, 0, &staging.base.b, i, &box);
|
||||
}
|
||||
}
|
||||
res->rebind_count++;
|
||||
if (old_obj->exportable) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue