diff options
author | Lauren Budorick <lauren@mapbox.com> | 2017-09-21 14:26:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-21 14:26:48 -0700 |
commit | a9ddf5b7fd311ffb9215a682ab2387181189071e (patch) | |
tree | 50e31aa30c8f58e6a82e6ff6dc2f5896ea963889 /test | |
parent | b91d9676a60204f2c9ee8803dec243d49f97e599 (diff) | |
download | qtlocation-mapboxgl-a9ddf5b7fd311ffb9215a682ab2387181189071e.tar.gz |
Preserve depth buffer between 3D layers + optimize render order (#9931)
Port of https://github.com/mapbox/mapbox-gl-js/pull/5101: adds a new render pass `Pass3D` before any other rendering wherein we render layers with 3D passes (fill-extrusion layers) to offscreen framebuffers, sharing a depth renderbuffer between those layers in order to render 3D space correctly. Those framebuffers are saved on the RenderLayers and copied back to the map during the translucent pass. Rendering to offscreen framebuffers before we do any clear + draw means we can avoid expensive framebuffer restores.
Diffstat (limited to 'test')
-rw-r--r-- | test/renderer/backend_scope.test.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/renderer/backend_scope.test.cpp b/test/renderer/backend_scope.test.cpp index 06bf1e7750..66cf88a9c6 100644 --- a/test/renderer/backend_scope.test.cpp +++ b/test/renderer/backend_scope.test.cpp @@ -12,6 +12,10 @@ public: void bind() override { } + mbgl::Size getFramebufferSize() const override { + return mbgl::Size{}; + } + void activate() override { if (activateFunction) activateFunction(); } @@ -87,15 +91,15 @@ TEST(BackendScope, NestedScopes) { TEST(BackendScope, ChainedScopes) { bool activatedA = false; bool activatedB = false; - + StubRendererBackend backendA; backendA.activateFunction = [&] { activatedA = true; }; backendA.deactivateFunction = [&] { activatedA = false; }; - + StubRendererBackend backendB; backendB.activateFunction = [&] { activatedB = true; }; backendB.deactivateFunction = [&] { activatedB = false; }; - + { BackendScope scopeA { backendA }; ASSERT_TRUE(activatedA); @@ -107,7 +111,7 @@ TEST(BackendScope, ChainedScopes) { ASSERT_FALSE(activatedB); ASSERT_TRUE(activatedA); } - + ASSERT_FALSE(activatedA); ASSERT_FALSE(activatedB); } |