diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-06-20 09:31:56 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-20 21:31:47 +0200 |
commit | e357f015391ac32e8d262b4ea2bd0e3fe1e87fe6 (patch) | |
tree | 0870b87fae54491f2b11ab6aece7fa19c52e0e6c /src/quick/scenegraph | |
parent | 5d4b006181d009e6245d5d38c7798603ddcab06a (diff) |
Revert "Cut performance cost in QSGContext::prepareMaterial()".
This reverts commit 0e9cd8b4098661bf611fa73a787c58c85e7d7338.
This optimization breaks ShaderEffects with changing fragment
and vertex shaders and needs some more thought.
Task-number: QTBUG-31837
Change-Id: I1abe249c65dd785825c249a7c22baee928bd76c8
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgmaterial.cpp | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgmaterial.h | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 9 |
3 files changed, 1 insertions, 10 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.cpp b/src/quick/scenegraph/coreapi/qsgmaterial.cpp index 9346236db9..c0794d0d69 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterial.cpp +++ b/src/quick/scenegraph/coreapi/qsgmaterial.cpp @@ -556,7 +556,6 @@ static void qt_print_material_count() QSGMaterial::QSGMaterial() : m_flags(0) - , m_reserved(0) { #ifndef QT_NO_DEBUG if (qsg_leak_check) { diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.h b/src/quick/scenegraph/coreapi/qsgmaterial.h index 20ab21ad28..ee8889deac 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterial.h +++ b/src/quick/scenegraph/coreapi/qsgmaterial.h @@ -133,7 +133,6 @@ public: void setFlag(Flags flags, bool on = true); private: - friend class QSGContext; Flags m_flags; void *m_reserved; Q_DISABLE_COPY(QSGMaterial) diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 866d678412..a142a23c67 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -507,16 +507,10 @@ QSGDepthStencilBufferManager *QSGContext::depthStencilBufferManager() QSGMaterialShader *QSGContext::prepareMaterial(QSGMaterial *material) { Q_D(QSGContext); - - if (material->m_reserved) - return reinterpret_cast<QSGMaterialShader *>(material->m_reserved); - QSGMaterialType *type = material->type(); QSGMaterialShader *shader = d->materials.value(type); - if (shader) { - material->m_reserved = shader; + if (shader) return shader; - } #ifndef QSG_NO_RENDER_TIMING if (qsg_render_timing || QQmlProfilerService::enabled) @@ -524,7 +518,6 @@ QSGMaterialShader *QSGContext::prepareMaterial(QSGMaterial *material) #endif shader = material->createShader(); - material->m_reserved = shader; shader->compile(); shader->initialize(); d->materials[type] = shader; |