Adjust surface type usage for onscreen tests in tst_qrhi

Change-Id: I1ae076f8bb44e00bf9ff7706063344e8c5502101
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
bb10
Laszlo Agocs 2021-01-04 12:46:54 +01:00
parent f6cb24f4c0
commit 8da171a5ae
1 changed files with 7 additions and 6 deletions

View File

@ -2754,23 +2754,24 @@ void tst_QRhi::renderToTextureMultipleUniformBuffersAndDynamicOffset()
void tst_QRhi::setWindowType(QWindow *window, QRhi::Implementation impl)
{
switch (impl) {
#ifdef TST_GL
case QRhi::OpenGLES2:
#if QT_CONFIG(opengl)
window->setFormat(QRhiGles2InitParams::adjustedFormat());
#endif
Q_FALLTHROUGH();
case QRhi::D3D11:
window->setSurfaceType(QSurface::OpenGLSurface);
break;
#endif
case QRhi::D3D11:
window->setSurfaceType(QSurface::Direct3DSurface);
break;
case QRhi::Metal:
window->setSurfaceType(QSurface::MetalSurface);
break;
#ifdef TST_VK
case QRhi::Vulkan:
window->setSurfaceType(QSurface::VulkanSurface);
#if QT_CONFIG(vulkan)
window->setVulkanInstance(&vulkanInstance);
#endif
break;
#endif
default:
break;
}