zink/kopper: add a mechanism for checking swapchain status

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
This commit is contained in:
Mike Blumenkrantz 2022-04-27 09:56:29 -04:00
parent 0d4b79d111
commit c9f29c22b8
2 changed files with 13 additions and 1 deletions

View file

@ -773,3 +773,14 @@ zink_kopper_fixup_depth_buffer(struct zink_context *ctx)
zink_surface_reference(screen, &csurf->surf, cz->surf);
pipe_surface_release(&ctx->base, &psurf);
}
bool
zink_kopper_check(struct pipe_resource *pres)
{
struct zink_resource *res = zink_resource(pres);
assert(pres->bind & PIPE_BIND_DISPLAY_TARGET);
if (!res->obj->dt)
return false;
struct kopper_displaytarget *cdt = kopper_displaytarget(res->obj->dt);
return !cdt->is_kill;
}

View file

@ -114,5 +114,6 @@ bool
zink_kopper_update(struct pipe_screen *pscreen, struct pipe_resource *pres, int *w, int *h);
void
zink_kopper_fixup_depth_buffer(struct zink_context *ctx);
bool
zink_kopper_check(struct pipe_resource *pres);
#endif