Don't return VK_SUBOPTIMAL_KHR for headless surfaces.

This fixes a regression caused by a recent change that keeps size
of headless surfaces at the special value {0xFFFFFFFF, 0xFFFFFFFF}.
This commit is contained in:
Bill Hollings 2024-02-12 15:53:58 -05:00
parent 885960ac99
commit 9c812da6a6

View File

@ -128,11 +128,11 @@ VkResult MVKSwapchain::getSurfaceStatus() {
return VK_SUCCESS; return VK_SUCCESS;
} }
// This swapchain is optimally sized for the surface if the app has specified // This swapchain is optimally sized for the surface if the app has specified deliberate
// deliberate swapchain scaling, or the surface extent has not changed since the // swapchain scaling, or if the surface is headless, or if the surface extent has not changed
// swapchain was created, and the surface will not need to be scaled when composited. // since the swapchain was created, and the surface will not need to be scaled when composited.
bool MVKSwapchain::hasOptimalSurface() { bool MVKSwapchain::hasOptimalSurface() {
if (_isDeliberatelyScaled) { return true; } if (_isDeliberatelyScaled || isHeadless()) { return true; }
VkExtent2D surfExtent = _surface->getExtent(); VkExtent2D surfExtent = _surface->getExtent();
return (mvkVkExtent2DsAreEqual(surfExtent, _imageExtent) && return (mvkVkExtent2DsAreEqual(surfExtent, _imageExtent) &&