Vulkan+Wayland fixes (#271)
* Process wayland events with vulkan renderer. * Handle vulkan offscreen swapchain size selection.
This commit is contained in:
parent
e62a712ee9
commit
2efeab6a4c
2 changed files with 21 additions and 3 deletions
|
@ -1489,7 +1489,14 @@ static void WL_SwapBuffers(void)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case QR_VULKAN: //the vulkan stuff handles this itself. FIXME: are we still receiving inputs? no idea!
|
case QR_VULKAN:
|
||||||
|
if (pwl_display_dispatch_pending(w.display) < 0)
|
||||||
|
{
|
||||||
|
Con_Printf(CON_ERROR "wayland connection was lost. Restarting video\n");
|
||||||
|
Cbuf_InsertText("vid_restart", RESTRICT_LOCAL, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -715,8 +715,19 @@ static qboolean VK_CreateSwapChain(void)
|
||||||
swapinfo.minImageCount = surfcaps.maxImageCount;
|
swapinfo.minImageCount = surfcaps.maxImageCount;
|
||||||
if (swapinfo.minImageCount < surfcaps.minImageCount)
|
if (swapinfo.minImageCount < surfcaps.minImageCount)
|
||||||
swapinfo.minImageCount = surfcaps.minImageCount;
|
swapinfo.minImageCount = surfcaps.minImageCount;
|
||||||
swapinfo.imageExtent.width = surfcaps.currentExtent.width;
|
|
||||||
swapinfo.imageExtent.height = surfcaps.currentExtent.height;
|
// With offscreen rendering, the size is not known at first
|
||||||
|
if (surfcaps.currentExtent.width == UINT32_MAX && surfcaps.currentExtent.height == UINT32_MAX)
|
||||||
|
{
|
||||||
|
swapinfo.imageExtent.width = bound(surfcaps.minImageExtent.width, vid.pixelwidth, surfcaps.maxImageExtent.width);
|
||||||
|
swapinfo.imageExtent.height = bound(surfcaps.minImageExtent.height, vid.pixelheight, surfcaps.maxImageExtent.height);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
swapinfo.imageExtent.width = surfcaps.currentExtent.width;
|
||||||
|
swapinfo.imageExtent.height = surfcaps.currentExtent.height;
|
||||||
|
}
|
||||||
|
|
||||||
swapinfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT|VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
|
swapinfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT|VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
|
||||||
swapinfo.preTransform = surfcaps.currentTransform;//VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
|
swapinfo.preTransform = surfcaps.currentTransform;//VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
|
||||||
if (surfcaps.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR)
|
if (surfcaps.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR)
|
||||||
|
|
Loading…
Reference in a new issue