diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-09-03 17:36:07 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-09-12 06:43:23 +0300 |
commit | 82574e7d6317898600958c356053cfdaa7321c32 (patch) | |
tree | d4d099d426094292a01e81cbb3f389a20a961cfc /src/api/studio3dqml/q3dsstudio3d.cpp | |
parent | 0d6360909793aab11c66f4b8f7001f71cbacfee7 (diff) |
Implement shader caching
Currently loaded shaders can now cached with an API call in either
source code or binary format.
It is necessary to do it that way as the shader cache can only be
created in the target hardware.
Task-number: QT3DS-3914
Change-Id: I094e8624943904c311ada2259a84b8c183f792f5
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/api/studio3dqml/q3dsstudio3d.cpp')
-rw-r--r-- | src/api/studio3dqml/q3dsstudio3d.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/api/studio3dqml/q3dsstudio3d.cpp b/src/api/studio3dqml/q3dsstudio3d.cpp index 19cf09b..4cb0850 100644 --- a/src/api/studio3dqml/q3dsstudio3d.cpp +++ b/src/api/studio3dqml/q3dsstudio3d.cpp @@ -366,7 +366,11 @@ void Q3DSStudio3D::reset() m_pendingCommands.m_sourceChanged = true; m_pendingCommands.m_source = m_presentation ? m_presentation->source() : QString(); m_pendingCommands.m_variantListChanged = true; - m_pendingCommands.m_variantList = m_presentation ? m_presentation->variantList() : QStringList(); + m_pendingCommands.m_variantList = m_presentation ? m_presentation->variantList() + : QStringList(); + m_pendingCommands.m_shaderCacheFileChanged = true; + m_pendingCommands.m_shaderCacheFile = m_presentation ? m_presentation->shaderCacheFile() + : QString(); } /*! @@ -385,23 +389,16 @@ void Q3DSStudio3D::requestResponseHandler(const QString &elementPath, CommandTyp qWarning() << __FUNCTION__ << "RequestSlideInfo response got for unregistered scene."; break; } - case CommandType_RequestDataInputs: { + case CommandType_RequestDataInputs: + case CommandType_RequestDataOutputs: + case CommandType_RequestExportShaderCache: + { Q3DSPresentation *handler = qobject_cast<Q3DSPresentation *>(m_presentation); if (handler) { handler->d_ptr->requestResponseHandler(commandType, requestData); } else { - qWarning() << __FUNCTION__ - << "RequestDataInputs response got for invalid presentation."; - } - break; - } - case CommandType_RequestDataOutputs: { - Q3DSPresentation *handler = qobject_cast<Q3DSPresentation *>(m_presentation); - if (handler) { - handler->d_ptr->requestResponseHandler(commandType, requestData); - } else { - qWarning() << __FUNCTION__ - << "RequestDataOutputs response got for invalid presentation."; + qWarning() << __FUNCTION__ << "Command " << commandType + << "response got for invalid presentation."; } break; } |