summaryrefslogtreecommitdiffstats
path: root/src/engine/Qt3DSRuntimeView.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2019-09-03 17:36:07 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2019-09-12 06:43:23 +0300
commit82574e7d6317898600958c356053cfdaa7321c32 (patch)
treed4d099d426094292a01e81cbb3f389a20a961cfc /src/engine/Qt3DSRuntimeView.cpp
parent0d6360909793aab11c66f4b8f7001f71cbacfee7 (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/engine/Qt3DSRuntimeView.cpp')
-rw-r--r--src/engine/Qt3DSRuntimeView.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/engine/Qt3DSRuntimeView.cpp b/src/engine/Qt3DSRuntimeView.cpp
index f9a4768..3ab577c 100644
--- a/src/engine/Qt3DSRuntimeView.cpp
+++ b/src/engine/Qt3DSRuntimeView.cpp
@@ -171,7 +171,7 @@ public:
bool BeginLoad(const QString &sourcePath, const QStringList &variantList) override;
bool HasOfflineLoadingCompleted() override;
bool InitializeGraphics(const QSurfaceFormat &format, bool delayedLoading,
- bool initInRenderThread) override;
+ bool initInRenderThread, const QByteArray &shaderCache) override;
void connectSignals() override;
void finishAsyncInit() override;
@@ -237,6 +237,7 @@ public:
void unloadSlide(const QString &slide) override;
void setDelayedLoading(bool enable) override;
void BootupPreGraphicsInitObjects();
+ QByteArray exportShaderCache(bool binaryShaders);
};
CRuntimeView::CRuntimeView(ITimeProvider &inTimeProvider, IWindowSystem &inWindowSystem,
@@ -298,7 +299,7 @@ bool CRuntimeView::HasOfflineLoadingCompleted()
}
bool CRuntimeView::InitializeGraphics(const QSurfaceFormat &format, bool delayedLoading,
- bool initInRenderThread)
+ bool initInRenderThread, const QByteArray &shaderCache)
{
m_ApplicationCore->EndLoad();
// Next call will initialize the render portion of the scenes. This *must* have a loaded
@@ -306,7 +307,8 @@ bool CRuntimeView::InitializeGraphics(const QSurfaceFormat &format, bool delayed
m_RuntimeFactory = m_RuntimeFactoryCore->CreateRenderFactory(format, delayedLoading);
m_Application
= m_ApplicationCore->CreateApplication(*m_InputEngine, m_AudioPlayer,
- *m_RuntimeFactory, initInRenderThread);
+ *m_RuntimeFactory, shaderCache,
+ initInRenderThread);
if (!m_Application->createSuccessful())
return false;