From 81667ae4e922aed3581649d227815bb71bb39347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Tue, 2 Apr 2019 14:11:37 +0200 Subject: [core] end the RenderPass/CommandEncoder before sending events --- src/mbgl/renderer/renderer_impl.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/mbgl/renderer/renderer_impl.cpp') 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 Renderer::Impl::queryRenderedFeatures(const ScreenLineString& geometry, const RenderedQueryOptions& options) const { -- cgit v1.2.1