Module: Mesa Branch: main Commit: 0394f35424350a387e449fb3954df89f51657752 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0394f35424350a387e449fb3954df89f51657752
Author: Mike Blumenkrantz <[email protected]> Date: Wed Apr 27 09:56:29 2022 -0400 zink/kopper: add a mechanism for checking swapchain status Reviewed-by: Adam Jackson <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038> --- src/gallium/drivers/zink/zink_kopper.c | 11 +++++++++++ src/gallium/drivers/zink/zink_kopper.h | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_kopper.c b/src/gallium/drivers/zink/zink_kopper.c index 33de8bd17ea..53431b3d4ae 100644 --- a/src/gallium/drivers/zink/zink_kopper.c +++ b/src/gallium/drivers/zink/zink_kopper.c @@ -789,3 +789,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; +} diff --git a/src/gallium/drivers/zink/zink_kopper.h b/src/gallium/drivers/zink/zink_kopper.h index 77c102a261d..6d5249ebb17 100644 --- a/src/gallium/drivers/zink/zink_kopper.h +++ b/src/gallium/drivers/zink/zink_kopper.h @@ -115,5 +115,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
