summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-04-02 14:11:37 +0200
committerKonstantin Käfer <mail@kkaefer.com>2019-05-28 16:11:05 +0200
commit81667ae4e922aed3581649d227815bb71bb39347 (patch)
treea7f38cb409bbb9d20fba1aff0a658771c26460f9 /src
parent18c0590ddda44b7e9cf626c6d13e35136ef3897d (diff)
downloadqtlocation-mapboxgl-81667ae4e922aed3581649d227815bb71bb39347.tar.gz
[core] end the RenderPass/CommandEncoder before sending events
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/renderer/paint_parameters.hpp2
-rw-r--r--src/mbgl/renderer/renderer_impl.cpp17
2 files changed, 12 insertions, 7 deletions
diff --git a/src/mbgl/renderer/paint_parameters.hpp b/src/mbgl/renderer/paint_parameters.hpp
index 84106bcd50..e57e49a615 100644
--- a/src/mbgl/renderer/paint_parameters.hpp
+++ b/src/mbgl/renderer/paint_parameters.hpp
@@ -56,7 +56,7 @@ public:
gfx::Context& context;
gfx::RendererBackend& backend;
- const std::unique_ptr<gfx::CommandEncoder> encoder;
+ std::unique_ptr<gfx::CommandEncoder> encoder;
std::unique_ptr<gfx::RenderPass> renderPass;
const TransformState& state;
diff --git a/src/mbgl/renderer/renderer_impl.cpp b/src/mbgl/renderer/renderer_impl.cpp
index 483b534b5a..201d46ebac 100644
--- a/src/mbgl/renderer/renderer_impl.cpp
+++ b/src/mbgl/renderer/renderer_impl.cpp
@@ -505,6 +505,17 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) {
}
#endif
+ // Ends the RenderPass
+ parameters.renderPass.reset();
+
+ if (updateParameters.mode == MapMode::Continuous) {
+ parameters.encoder->present(parameters.backend.getDefaultRenderable());
+ }
+
+ // CommandEncoder destructor submits render commands.
+ parameters.encoder.reset();
+
+
const bool needsRepaint = isMapModeContinuous && hasTransitions(parameters.timePoint);
observer->onDidFinishRenderingFrame(
loaded ? RendererObserver::RenderMode::Full : RendererObserver::RenderMode::Partial,
@@ -521,12 +532,6 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) {
// and there are no ongoing transitions.
imageManager->reduceMemoryUseIfCacheSizeExceedsLimit();
}
-
- if (updateParameters.mode == MapMode::Continuous) {
- parameters.encoder->present(parameters.backend.getDefaultRenderable());
- }
-
- // CommandEncoder destructor submits render commands.
}
std::vector<Feature> Renderer::Impl::queryRenderedFeatures(const ScreenLineString& geometry, const RenderedQueryOptions& options) const {