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.
This commit is contained in:
Lauren Budorick
2017-09-21 14:26:48 -07:00
committed by GitHub
parent b91d9676a6
commit a9ddf5b7fd
23 changed files with 223 additions and 154 deletions

View File

@@ -115,6 +115,10 @@ void NativeMapView::bind() {
setViewport(0, 0, getFramebufferSize());
}
mbgl::Size NativeMapView::getFramebufferSize() const {
return { static_cast<uint32_t>(fbWidth), static_cast<uint32_t>(fbHeight) };
}
/**
* From mbgl::RendererBackend.
*/
@@ -1428,10 +1432,6 @@ void NativeMapView::_destroySurface() {
}
}
mbgl::Size NativeMapView::getFramebufferSize() const {
return { static_cast<uint32_t>(fbWidth), static_cast<uint32_t>(fbHeight) };
}
void NativeMapView::updateAssumedState() {
assumeFramebufferBinding(0);
assumeViewport(0, 0, getFramebufferSize());