Without this change, it is not possible to implement a custom renderer
(it has no way to compile or initialize material shaders).
Change-Id: Ie8778f739f3551f88f0d44ccb9769063a87ff276
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Q_DECLARE_PRIVATE(QSGMaterialShader)
QSGMaterialShader(QSGMaterialShaderPrivate &dd);
- friend class QSGContext;
+ friend class QSGRenderContext;
friend class QSGBatchRenderer::ShaderManager;
void setShaderSourceFile(QOpenGLShader::ShaderType type, const QString &sourceFile);
}
/*!
+ compile/initialize are protected member functions of QSGMaterialShader.
+ We expose them here for custom renderers.
+ */
+void QSGRenderContext::compileShader(QSGMaterialShader *shader)
+{
+ shader->compile();
+}
+
+void QSGRenderContext::initializeShader(QSGMaterialShader *shader)
+{
+ shader->initialize();
+}
+
+/*!
Initializes the scene graph render context with the GL context \a context. This also
emits the ready() signal so that the QML graph can start building scene graph nodes.
*/
bool hasBrokenIndexBufferObjects() const { return m_brokenIBOs; }
+ void compileShader(QSGMaterialShader *shader);
+ void initializeShader(QSGMaterialShader *shader);
+
Q_SIGNALS:
void initialized();
void invalidated();