Fix for crash when changing number of layers in GlobeBrowsing

This commit is contained in:
Alexander Bock
2020-08-21 17:08:52 +02:00
parent f1b05c23e7
commit c1fef73faf

View File

@@ -923,21 +923,6 @@ void RenderableGlobe::update(const UpdateData& data) {
_shadowComponent.update(data);
}
_layerManager.update();
if (_nLayersIsDirty) {
std::array<LayerGroup*, LayerManager::NumLayerGroups> lgs =
_layerManager.layerGroups();
_generalProperties.nActiveLayers = std::accumulate(
lgs.begin(),
lgs.end(),
0,
[](int lhs, LayerGroup* lg) {
return lhs + static_cast<int>(lg->activeLayers().size());
}
);
_nLayersIsDirty = false;
}
}
bool RenderableGlobe::renderedWithDesiredData() const {
@@ -970,6 +955,22 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
{
ZoneScoped
_layerManager.update();
if (_nLayersIsDirty) {
std::array<LayerGroup*, LayerManager::NumLayerGroups> lgs =
_layerManager.layerGroups();
_generalProperties.nActiveLayers = std::accumulate(
lgs.begin(),
lgs.end(),
0,
[](int lhs, LayerGroup* lg) {
return lhs + static_cast<int>(lg->activeLayers().size());
}
);
_nLayersIsDirty = false;
}
if (_shadersNeedRecompilation) {
recompileShaders();
}