diff --git a/.pick_status.json b/.pick_status.json index f93b5b7b1ae..0aad7d91c6f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -85,7 +85,7 @@ "description": "zink: add a flag indicating whether scanout object needs updating", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "104603fa763c52e98a79785dd514beab949546db" }, diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c index ae696b347f7..7fe5f860d40 100644 --- a/src/gallium/drivers/zink/zink_batch.c +++ b/src/gallium/drivers/zink/zink_batch.c @@ -362,6 +362,8 @@ copy_scanout(struct zink_context *ctx, struct zink_resource *res) struct pipe_box *src_box = &box; unsigned dstz = 0; + if (!res->scanout_dirty) + return; region.srcSubresource.aspectMask = res->aspect; region.srcSubresource.mipLevel = 0; switch (res->base.b.target) { @@ -469,6 +471,7 @@ copy_scanout(struct zink_context *ctx, struct zink_resource *res) ); /* separate flag to avoid annoying validation errors for new scanout objs */ res->scanout_obj_init = true; + res->scanout_dirty = false; } void @@ -555,6 +558,7 @@ zink_batch_reference_resource_rw(struct zink_batch *batch, struct zink_resource zink_batch_usage_set(&stencil->obj->writes, batch->state->fence.batch_id); zink_batch_usage_set(&res->obj->writes, batch->state->fence.batch_id); } + res->scanout_dirty = !!res->scanout_obj; } else { if (res->obj->reads.usage != batch->state->fence.batch_id) { if (stencil) diff --git a/src/gallium/drivers/zink/zink_resource.h b/src/gallium/drivers/zink/zink_resource.h index c298c8fe3d2..74234e56055 100644 --- a/src/gallium/drivers/zink/zink_resource.h +++ b/src/gallium/drivers/zink/zink_resource.h @@ -90,6 +90,7 @@ struct zink_resource { struct zink_resource_object *obj; struct zink_resource_object *scanout_obj; //TODO: remove for wsi bool scanout_obj_init; + bool scanout_dirty; union { struct util_range valid_buffer_range; struct {