mirror of https://github.com/qt/qtbase.git
Fix build of RHI stereoscopic rendering manual test when missing Vulkan
Change-Id: I450eee9084d20951efdde3ae24a25d5ebcc2d5a2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
parent
dea21545b3
commit
a67b51f3de
|
@ -16,12 +16,14 @@ Window::Window(QRhi::Implementation graphicsApi)
|
||||||
case QRhi::OpenGLES2:
|
case QRhi::OpenGLES2:
|
||||||
setSurfaceType(OpenGLSurface);
|
setSurfaceType(OpenGLSurface);
|
||||||
break;
|
break;
|
||||||
|
#if QT_CONFIG(vulkan)
|
||||||
case QRhi::Vulkan:
|
case QRhi::Vulkan:
|
||||||
instance.setLayers({ "VK_LAYER_KHRONOS_validation" });
|
instance.setLayers({ "VK_LAYER_KHRONOS_validation" });
|
||||||
instance.create();
|
instance.create();
|
||||||
setVulkanInstance(&instance);
|
setVulkanInstance(&instance);
|
||||||
setSurfaceType(VulkanSurface);
|
setSurfaceType(VulkanSurface);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case QRhi::D3D11:
|
case QRhi::D3D11:
|
||||||
case QRhi::D3D12:
|
case QRhi::D3D12:
|
||||||
setSurfaceType(Direct3DSurface);
|
setSurfaceType(Direct3DSurface);
|
||||||
|
@ -74,6 +76,7 @@ void Window::init()
|
||||||
QRhi::Flags rhiFlags = QRhi::EnableDebugMarkers;
|
QRhi::Flags rhiFlags = QRhi::EnableDebugMarkers;
|
||||||
|
|
||||||
switch (m_graphicsApi) {
|
switch (m_graphicsApi) {
|
||||||
|
#if QT_CONFIG(vulkan)
|
||||||
case QRhi::Vulkan:
|
case QRhi::Vulkan:
|
||||||
{
|
{
|
||||||
QRhiVulkanInitParams params;
|
QRhiVulkanInitParams params;
|
||||||
|
@ -82,6 +85,7 @@ void Window::init()
|
||||||
m_rhi.reset(QRhi::create(QRhi::Vulkan, ¶ms, rhiFlags));
|
m_rhi.reset(QRhi::create(QRhi::Vulkan, ¶ms, rhiFlags));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
case QRhi::Null:
|
case QRhi::Null:
|
||||||
case QRhi::Metal:
|
case QRhi::Metal:
|
||||||
case QRhi::OpenGLES2:
|
case QRhi::OpenGLES2:
|
||||||
|
|
|
@ -16,7 +16,9 @@ public:
|
||||||
void releaseSwapChain();
|
void releaseSwapChain();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
#if QT_CONFIG(vulkan)
|
||||||
QVulkanInstance instance;
|
QVulkanInstance instance;
|
||||||
|
#endif
|
||||||
std::unique_ptr<QOffscreenSurface> m_fallbackSurface;
|
std::unique_ptr<QOffscreenSurface> m_fallbackSurface;
|
||||||
std::unique_ptr<QRhi> m_rhi;
|
std::unique_ptr<QRhi> m_rhi;
|
||||||
std::unique_ptr<QRhiSwapChain> m_sc;
|
std::unique_ptr<QRhiSwapChain> m_sc;
|
||||||
|
|
Loading…
Reference in New Issue