vkkhrdisplay: Create the platform window always
No matter what the surface type was. We only support VulkanSurface, so if the type is something else, then a a qWarning is in order, but instead of returning nullptr (which will almost certainly cause a fail or crash in some form), we can just carry on normally. The resulting window will not be renderable from the application of course, but that is not always needed in fact, plus failing gracefully is nicer. The tst_qrhi autotest can now be run on the RPi4 also with -platform vkkhrdisplay. While there are some odd messages occurring from Mesa and co., the run now completes normally, with no failures. Change-Id: I77bd249096aede8e05458559458581d702054540 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit e025b07c64a44e0fdf05b34bd183177d18a295a2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
a5619e19f9
commit
496147fd3f
@ -219,7 +219,11 @@ QPlatformWindow *QVkKhrDisplayIntegration::createPlatformWindow(QWindow *window)
|
||||
{
|
||||
if (window->surfaceType() != QSurface::VulkanSurface) {
|
||||
qWarning("vkkhrdisplay platform plugin only supports QWindow with surfaceType == VulkanSurface");
|
||||
return nullptr;
|
||||
// Assume VulkanSurface, better than crashing. Consider e.g. an autotest
|
||||
// creating a default QWindow just to have something to be used with
|
||||
// QRhi's Null backend. Continuing to set up a Vulkan window (even
|
||||
// though the request was Raster or something) is better than failing to
|
||||
// create a platform window, and may even be sufficient in some cases.
|
||||
}
|
||||
|
||||
QVkKhrDisplayWindow *w = new QVkKhrDisplayWindow(window);
|
||||
|
Loading…
x
Reference in New Issue
Block a user