diff options
author | Svenn-Arne Dragly <svenn-arne.dragly@qt.io> | 2018-01-22 10:42:36 +0100 |
---|---|---|
committer | Svenn-Arne Dragly <svenn-arne.dragly@qt.io> | 2018-02-01 12:29:54 +0000 |
commit | d02c54e3349e04fd21f22e67bf88c4a1631faf45 (patch) | |
tree | e3d51bf6d3b6dd9a4b0e54683b6d47eb119ce79c /src/render/jobs | |
parent | a819190eb71ceb6bb9202f0b3497cc117d8331e7 (diff) |
Fix OnDemand render policy
The OnDemand render policy has no effect because the ShadersDirty and
ComputeDirty flags are always set. This commit resets ShadersDirty so
that ShaderGathererJob is only run when needed. It also introduces the
TechniquesDirty flag so we know when to run
FilterCompatibleTechniqueJob and makes sure the job is only run if
the context has been initialized and the renderer is running.
Task-number: QTBUG-65965
Change-Id: Icbcc03ed2dc6b14c6580cc794267b5a88e5f4ca2
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/jobs')
-rw-r--r-- | src/render/jobs/filtercompatibletechniquejob.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/render/jobs/filtercompatibletechniquejob.cpp b/src/render/jobs/filtercompatibletechniquejob.cpp index 362e4088f..080ccd306 100644 --- a/src/render/jobs/filtercompatibletechniquejob.cpp +++ b/src/render/jobs/filtercompatibletechniquejob.cpp @@ -79,14 +79,13 @@ Renderer *FilterCompatibleTechniqueJob::renderer() const void FilterCompatibleTechniqueJob::run() { Q_ASSERT(m_manager != nullptr && m_renderer != nullptr); + Q_ASSERT(m_renderer->isRunning() && m_renderer->graphicsContext()->isInitialized()); - if (m_renderer->isRunning() && m_renderer->graphicsContext()->isInitialized()) { - const QVector<Qt3DCore::QNodeId> dirtyTechniqueIds = m_manager->takeDirtyTechniques(); - for (const Qt3DCore::QNodeId techniqueId : dirtyTechniqueIds) { - Technique *technique = m_manager->lookupResource(techniqueId); - if (Q_LIKELY(technique != nullptr)) - technique->setCompatibleWithRenderer((*m_renderer->contextInfo() == *technique->graphicsApiFilter())); - } + const QVector<Qt3DCore::QNodeId> dirtyTechniqueIds = m_manager->takeDirtyTechniques(); + for (const Qt3DCore::QNodeId techniqueId : dirtyTechniqueIds) { + Technique *technique = m_manager->lookupResource(techniqueId); + if (Q_LIKELY(technique != nullptr)) + technique->setCompatibleWithRenderer((*m_renderer->contextInfo() == *technique->graphicsApiFilter())); } } |