diff options
Diffstat (limited to 'src/quick/items/qquickshadereffect.cpp')
-rw-r--r-- | src/quick/items/qquickshadereffect.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp index eb5256fa4e..b3c8386fd9 100644 --- a/src/quick/items/qquickshadereffect.cpp +++ b/src/quick/items/qquickshadereffect.cpp @@ -44,6 +44,9 @@ #include <private/qquickopenglshadereffect_p.h> #endif #include <private/qquickgenericshadereffect_p.h> +#if QT_CONFIG(opengl) /* || QT_CONFIG(vulkan) || defined(Q_OS_WIN) || defined(Q_OS_DARWIN) */ +#include <private/qsgrhisupport_p.h> +#endif QT_BEGIN_NAMESPACE @@ -506,13 +509,20 @@ QQuickShaderEffect::QQuickShaderEffect(QQuickItem *parent) { setFlag(QQuickItem::ItemHasContents); +#if QT_CONFIG(opengl) /* || QT_CONFIG(vulkan) || defined(Q_OS_WIN) || defined(Q_OS_DARWIN) */ + if (QSGRhiSupport::instance()->isRhiEnabled()) { + m_impl = new QQuickGenericShaderEffect(this, this); + } else +#endif + { #if QT_CONFIG(opengl) - if (!qsg_backend_flags().testFlag(QSGContextFactoryInterface::SupportsShaderEffectNode)) - m_glImpl = new QQuickOpenGLShaderEffect(this, this); + if (!qsg_backend_flags().testFlag(QSGContextFactoryInterface::SupportsShaderEffectNode)) + m_glImpl = new QQuickOpenGLShaderEffect(this, this); - if (!m_glImpl) + if (!m_glImpl) #endif - m_impl = new QQuickGenericShaderEffect(this, this); + m_impl = new QQuickGenericShaderEffect(this, this); + } } QQuickShaderEffect::~QQuickShaderEffect() |