zink: handle swapchain currentExtent special value

according to spec this is somehow legal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29003>
This commit is contained in:
Mike Blumenkrantz 2024-05-01 09:19:48 -04:00 committed by Marge Bot
parent 2827ec97f8
commit 0217a7c007

View file

@ -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