diff --git a/src/gallium/drivers/zink/zink_kopper.c b/src/gallium/drivers/zink/zink_kopper.c index f919ff98e83..4bde8e6fcba 100644 --- a/src/gallium/drivers/zink/zink_kopper.c +++ b/src/gallium/drivers/zink/zink_kopper.c @@ -301,8 +301,18 @@ kopper_CreateSwapchain(struct zink_screen *screen, struct kopper_displaytarget * * Due to above restrictions, it is only possible to create a new swapchain on this * platform with imageExtent being equal to the current size of the window. */ - cswap->scci.imageExtent.width = cdt->caps.currentExtent.width; - cswap->scci.imageExtent.height = cdt->caps.currentExtent.height; + 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. + */ + cswap->scci.imageExtent.width = w; + cswap->scci.imageExtent.height = h; + } else { + cswap->scci.imageExtent.width = cdt->caps.currentExtent.width; + cswap->scci.imageExtent.height = cdt->caps.currentExtent.height; + } break; case KOPPER_WAYLAND: /* On Wayland, currentExtent is the special value (0xFFFFFFFF, 0xFFFFFFFF), indicating that the