summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/commons
diff options
context:
space:
mode:
authorSvenn-Arne Dragly <svenn-arne.dragly@qt.io>2018-01-22 10:42:55 +0100
committerSvenn-Arne Dragly <svenn-arne.dragly@qt.io>2018-02-02 10:20:11 +0000
commit46319648436814afb5a77755dde6681e304befaf (patch)
tree9a608913dd9be2ac99bb8e5ebf446dddd69c4c4f /tests/auto/render/commons
parent30abe028f9a95fa32fbb77cb60063d062e13f7ff (diff)
Keep rendering in sync with aspect jobs by adding barriers
This makes sure that jobs that depend on a specific state of the renderer (such as context being initialized) never run before this is the case. This reduces the number of possible race conditions and checks we need to do to ensure the jobs and the renderer are in the correct state. This way we no longer swap buffers when nothing has been rendered, which in turn makes sure that we only draw one frame when the render policy is OnDemand and there are no changes. This change also adds a number of assertions on pointers to resources to make it easier to detect missing job dependencies. Finally, this change overhauls the job dependencies in Renderer and RenderViewBuilder. Task-number: QTBUG-66024 Change-Id: I3e4e9dd0dd53b5c88f5c1b17d68df42f28eae794 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/auto/render/commons')
-rw-r--r--tests/auto/render/commons/testrenderer.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/auto/render/commons/testrenderer.h b/tests/auto/render/commons/testrenderer.h
index 20ab032b1..6f5f535ee 100644
--- a/tests/auto/render/commons/testrenderer.h
+++ b/tests/auto/render/commons/testrenderer.h
@@ -52,14 +52,14 @@ public:
void shutdown() Q_DECL_OVERRIDE {}
void releaseGraphicsResources() Q_DECL_OVERRIDE {}
void render() Q_DECL_OVERRIDE {}
- void doRender(bool scene3dBlocking = false) Q_DECL_OVERRIDE { Q_UNUSED(scene3dBlocking); }
+ void doRender() Q_DECL_OVERRIDE {}
void cleanGraphicsResources() Q_DECL_OVERRIDE {}
bool isRunning() const Q_DECL_OVERRIDE { return true; }
bool shouldRender() Q_DECL_OVERRIDE { return true; }
void skipNextFrame() Q_DECL_OVERRIDE {}
QVector<Qt3DCore::QAspectJobPtr> renderBinJobs() Q_DECL_OVERRIDE { return QVector<Qt3DCore::QAspectJobPtr>(); }
Qt3DCore::QAspectJobPtr pickBoundingVolumeJob() Q_DECL_OVERRIDE { return Qt3DCore::QAspectJobPtr(); }
- Qt3DCore::QAspectJobPtr syncTextureLoadingJob() Q_DECL_OVERRIDE { return Qt3DCore::QAspectJobPtr(); }
+ Qt3DCore::QAspectJobPtr syncSkeletonLoadingJob() Q_DECL_OVERRIDE { return Qt3DCore::QAspectJobPtr(); }
Qt3DCore::QAspectJobPtr expandBoundingVolumeJob() Q_DECL_OVERRIDE { return Qt3DCore::QAspectJobPtr(); }
void setSceneRoot(Qt3DCore::QBackendNodeFactory *factory, Qt3DRender::Render::Entity *root) Q_DECL_OVERRIDE { Q_UNUSED(factory); Q_UNUSED(root); }
Qt3DRender::Render::Entity *sceneRoot() const Q_DECL_OVERRIDE { return nullptr; }
@@ -80,6 +80,12 @@ public:
void setOffscreenSurfaceHelper(Qt3DRender::Render::OffscreenSurfaceHelper *helper) Q_DECL_OVERRIDE;
QSurfaceFormat format() Q_DECL_OVERRIDE;
+ void lockSurfaceAndRender() override {}
+ bool releaseRendererAndRequestPromiseToRender() override { return true; }
+ bool waitForRenderJobs() override { return true; }
+ bool tryWaitForRenderJobs(int timeout) override { Q_UNUSED(timeout); return true; }
+ void abortRenderJobs() override {}
+
protected:
Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet m_changes;
Qt3DRender::Render::NodeManagers *m_managers;