diff options
Diffstat (limited to 'src/runtimerender/Qt3DSRenderShaderCache.cpp')
-rw-r--r-- | src/runtimerender/Qt3DSRenderShaderCache.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/runtimerender/Qt3DSRenderShaderCache.cpp b/src/runtimerender/Qt3DSRenderShaderCache.cpp index c642360..fd2c669 100644 --- a/src/runtimerender/Qt3DSRenderShaderCache.cpp +++ b/src/runtimerender/Qt3DSRenderShaderCache.cpp @@ -383,7 +383,7 @@ struct ShaderCache : public IShaderCache const char8_t *inTessCtrl, const char8_t *inTessEval, const char8_t *inGeom, const SShaderCacheProgramFlags &inFlags, NVConstDataRef<SShaderPreprocessorFeature> inFeatures, - bool separableProgram, bool fromDisk = false) override + QString &errors, bool separableProgram, bool fromDisk = false) override { if (m_ShaderCompilationEnabled == false) return nullptr; @@ -421,14 +421,15 @@ struct ShaderCache : public IShaderCache if (!fromDisk) addShaderPreprocessors(inKey, inFlags, inFeatures, separableProgram, false); - theInserter.first->second = - m_RenderContext + NVRenderVertFragCompilationResult res = m_RenderContext .CompileSource(inKey, m_VertexCode.c_str(), QT3DSU32(m_VertexCode.size()), m_FragmentCode.c_str(), QT3DSU32(m_FragmentCode.size()), m_TessCtrlCode.c_str(), QT3DSU32(m_TessCtrlCode.size()), m_TessEvalCode.c_str(), QT3DSU32(m_TessEvalCode.size()), m_GeometryCode.c_str(), QT3DSU32(m_GeometryCode.size()), - separableProgram).mShader; + separableProgram); + theInserter.first->second = res.mShader; + errors = res.errors; // This is unnecessary memory waste in final deployed product, so we don't store this // information when shaders were initialized from a cache. @@ -462,9 +463,10 @@ struct ShaderCache : public IShaderCache if (theProgram) return theProgram; + QString error; NVRenderShaderProgram *retval = ForceCompileProgram(inKey, inVert, inFrag, inTessCtrl, inTessEval, inGeom, inFlags, - inFeatures, separableProgram); + inFeatures, error, separableProgram); return retval; } @@ -622,6 +624,7 @@ struct ShaderCache : public IShaderCache if (!loadVertexData.isEmpty() && (!loadFragmentData.isEmpty() || !loadGeometryData.isEmpty())) { + QString error; theShader = ForceCompileProgram( theKey, loadVertexData.constData(), loadFragmentData.constData(), @@ -631,7 +634,7 @@ struct ShaderCache : public IShaderCache SShaderCacheProgramFlags(), qt3ds::foundation::toDataRef( features.data(), static_cast<QT3DSU32>(features.size())), - false, true); + error, false, true); } } // If something doesn't save or load correctly, get the runtime to re-generate. |