From ad4c24b797f009ffda896e4dcce3351659792371 Mon Sep 17 00:00:00 2001 From: Karmjit Mahil Date: Thu, 2 May 2024 13:02:57 +0100 Subject: [PATCH] zink: Add missing currentExtent special value handling Fixes: 0217a7c0072 ("zink: handle swapchain currentExtent special value") Signed-off-by: Karmjit Mahil Part-of: --- src/gallium/drivers/zink/zink_kopper.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gallium/drivers/zink/zink_kopper.c b/src/gallium/drivers/zink/zink_kopper.c index 4bde8e6fcba..1a19e62497c 100644 --- a/src/gallium/drivers/zink/zink_kopper.c +++ b/src/gallium/drivers/zink/zink_kopper.c @@ -1061,6 +1061,18 @@ zink_kopper_update(struct pipe_screen *pscreen, struct pipe_resource *pres, int cdt->is_kill = true; return false; } + + if (cdt->caps.currentExtent.width == 0xFFFFFFFF && cdt->caps.currentExtent.height == 0xFFFFFFFF) { + /* + currentExtent is the current width and height of the surface, or the special value (0xFFFFFFFF, + 0xFFFFFFFF) indicating that the surface size will be determined by the extent of a swapchain + targeting the surface. + */ + *w = res->base.b.width0; + *h = res->base.b.height0; + return true; + } + *w = cdt->caps.currentExtent.width; *h = cdt->caps.currentExtent.height; return true;