mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
zink: add a flag indicating whether scanout object needs updating
this minimizes overhead of maintaining scanout objects Fixes:104603fa76("zink: create separate linear tiling image for scanout") Reviewed-by: Adam Jackson <ajax@redhat.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10358> (cherry picked from commit4dcd477d12)
This commit is contained in:
parent
d5869ccc75
commit
5f748f1e11
3 changed files with 6 additions and 1 deletions
|
|
@ -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"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue