summaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2020-02-07 14:12:42 +0200
committerAntti Määttä <antti.maatta@qt.io>2020-02-10 14:02:35 +0200
commitbff0bf78b328b730843abf0e79f58e8411908de5 (patch)
tree6fcf341f3d79dfc6d9af50d52b99f4c603fba287 /src/api
parent90dd0bdcf1c9e3a1eddee8abcf4307c06e82e37b (diff)
Implement shader cache loading error handling
Task-number: QT3DS-4040 Change-Id: Ie5f8284ab76cd4aa5f3ff0701457f4ef84c3e215 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/api')
-rw-r--r--src/api/studio3d/q3dspresentation.h1
-rw-r--r--src/api/studio3dqml/q3dsrenderer.cpp2
-rw-r--r--src/api/studio3dqml/q3dsrenderer_p.h1
-rw-r--r--src/api/studio3dqml/q3dsstudio3d.cpp2
4 files changed, 6 insertions, 0 deletions
diff --git a/src/api/studio3d/q3dspresentation.h b/src/api/studio3d/q3dspresentation.h
index 114eaec..1e8dedf 100644
--- a/src/api/studio3d/q3dspresentation.h
+++ b/src/api/studio3d/q3dspresentation.h
@@ -160,6 +160,7 @@ Q_SIGNALS:
void meshesCreated(const QStringList &meshNames, const QString &error);
void shaderCacheFileChanged(const QUrl &fileName);
void shaderCacheExported(bool success);
+ void shaderCacheLoadErrors(const QString &errors);
private:
Q_DISABLE_COPY(Q3DSPresentation)
diff --git a/src/api/studio3dqml/q3dsrenderer.cpp b/src/api/studio3dqml/q3dsrenderer.cpp
index c902934..1f78bf7 100644
--- a/src/api/studio3dqml/q3dsrenderer.cpp
+++ b/src/api/studio3dqml/q3dsrenderer.cpp
@@ -235,6 +235,8 @@ bool Q3DSRenderer::initializeRuntime(QOpenGLFramebufferObject *inFbo)
this, &Q3DSRenderer::presentationReady);
connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigPresentationLoaded,
this, &Q3DSRenderer::presentationLoaded);
+ connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigLoadShaderCacheErrors,
+ this, &Q3DSRenderer::shaderCacheLoadErrors);
int theWidth = inFbo->width();
int theHeight = inFbo->height();
diff --git a/src/api/studio3dqml/q3dsrenderer_p.h b/src/api/studio3dqml/q3dsrenderer_p.h
index dbc85a2..0ba6c31 100644
--- a/src/api/studio3dqml/q3dsrenderer_p.h
+++ b/src/api/studio3dqml/q3dsrenderer_p.h
@@ -81,6 +81,7 @@ Q_SIGNALS:
void materialsCreated(const QStringList &materialNames, const QString &error);
void meshesCreated(const QStringList &meshNames, const QString &error);
void dataOutputValueUpdated(const QString &name, const QVariant &newValue);
+ void shaderCacheLoadErrors(const QString &errors);
protected Q_SLOTS:
void handleRuntimeInitializedAsync();
diff --git a/src/api/studio3dqml/q3dsstudio3d.cpp b/src/api/studio3dqml/q3dsstudio3d.cpp
index f1e383f..503b713 100644
--- a/src/api/studio3dqml/q3dsstudio3d.cpp
+++ b/src/api/studio3dqml/q3dsstudio3d.cpp
@@ -430,6 +430,8 @@ QQuickFramebufferObject::Renderer *Q3DSStudio3D::createRenderer() const
m_presentation->d_ptr, &Q3DSPresentationPrivate::handleMaterialsCreated);
connect(renderer, &Q3DSRenderer::meshesCreated,
m_presentation->d_ptr, &Q3DSPresentationPrivate::handleMeshesCreated);
+ connect(renderer, &Q3DSRenderer::shaderCacheLoadErrors,
+ m_presentation, &Q3DSPresentation::shaderCacheLoadErrors);
connect(renderer, &Q3DSRenderer::exitSlide,
m_presentation, &Q3DSPresentation::slideExited);
connect(renderer, &Q3DSRenderer::customSignalEmitted,