diff options
Diffstat (limited to 'src/quick/scenegraph/qsgrhisupport_p.h')
-rw-r--r-- | src/quick/scenegraph/qsgrhisupport_p.h | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/src/quick/scenegraph/qsgrhisupport_p.h b/src/quick/scenegraph/qsgrhisupport_p.h index 42cbecabcb..535317d48c 100644 --- a/src/quick/scenegraph/qsgrhisupport_p.h +++ b/src/quick/scenegraph/qsgrhisupport_p.h @@ -18,25 +18,7 @@ #include "qsgrenderloop_p.h" #include "qsgrendererinterface.h" -#include <QtGui/private/qrhi_p.h> - -#include <QtGui/private/qrhinull_p.h> - -#if QT_CONFIG(opengl) -#include <QtGui/private/qrhigles2_p.h> -#endif - -#if QT_CONFIG(vulkan) -#include <QtGui/private/qrhivulkan_p.h> -#endif - -#ifdef Q_OS_WIN -#include <QtGui/private/qrhid3d11_p.h> -#endif - -#if defined(Q_OS_MACOS) || defined(Q_OS_IOS) -#include <QtGui/private/qrhimetal_p.h> -#endif +#include <rhi/qrhi.h> QT_BEGIN_NAMESPACE @@ -52,7 +34,7 @@ class QQuickGraphicsConfiguration; // In addition, the class provides handy conversion and query stuff for the // renderloop and the QSGRendererInterface implementations. // -class Q_QUICK_PRIVATE_EXPORT QSGRhiSupport +class Q_QUICK_EXPORT QSGRhiSupport { public: static QSGRhiSupport *instance_internal(); @@ -63,7 +45,7 @@ public: static void checkEnvQSgInfo(); #if QT_CONFIG(opengl) - static QRhiTexture::Format toRhiTextureFormatFromGL(uint format); + static QRhiTexture::Format toRhiTextureFormatFromGL(uint format, QRhiTexture::Flags *flags); #endif #if QT_CONFIG(vulkan) @@ -71,10 +53,10 @@ public: #endif #if defined(Q_OS_WIN) - static QRhiTexture::Format toRhiTextureFormatFromD3D11(uint format, QRhiTexture::Flags *flags); + static QRhiTexture::Format toRhiTextureFormatFromDXGI(uint format, QRhiTexture::Flags *flags); #endif -#if defined(Q_OS_MACOS) || defined(Q_OS_IOS) +#if QT_CONFIG(metal) static QRhiTexture::Format toRhiTextureFormatFromMetal(uint format, QRhiTexture::Flags *flags); #endif @@ -95,7 +77,7 @@ public: QRhi *rhi; bool own; }; - RhiCreateResult createRhi(QQuickWindow *window, QSurface *offscreenSurface); + RhiCreateResult createRhi(QQuickWindow *window, QSurface *offscreenSurface, bool forcePreferSwRenderer = false); void destroyRhi(QRhi *rhi, const QQuickGraphicsConfiguration &config); void prepareWindowForRhi(QQuickWindow *window); @@ -104,11 +86,12 @@ public: QImage grabOffscreenForProtectedContent(QQuickWindow *window); #endif - QRhiSwapChain::Format swapChainFormat() const { return m_swapChainFormat; } - void applySwapChainFormat(QRhiSwapChain *scWithWindowSet); + void applySwapChainFormat(QRhiSwapChain *scWithWindowSet, QQuickWindow *window); QRhiTexture::Format toRhiTextureFormat(uint nativeFormat, QRhiTexture::Flags *flags) const; + bool attemptReinitWithSwRastUponFail() const; + private: QSGRhiSupport(); void applySettings(); @@ -121,8 +104,6 @@ private: } m_requested; bool m_settingsApplied = false; QRhi::Implementation m_rhiBackend = QRhi::Null; - int m_killDeviceFrameCount; - QRhiSwapChain::Format m_swapChainFormat = QRhiSwapChain::SDR; }; QT_END_NAMESPACE |