diff -r 5d280bceb713 -r d891da20abca src/gl/compiler.cpp --- a/src/gl/compiler.cpp Tue Jun 28 22:18:11 2022 +0300 +++ b/src/gl/compiler.cpp Wed Jun 29 14:11:58 2022 +0300 @@ -224,10 +224,10 @@ template void iterateModelPolygons(Model* model, DocumentManager* context, Fn&& fn) { - PolygonCache* cache = findPolygonCacheForModel(model, context); + PolygonCache* const cache = findPolygonCacheForModel(model, context); if (cache != nullptr) { - const PolygonCache::vector_type* polygons = getCachedPolygons(cache, model, context); - for (const WithId& polygon : *polygons) { + recacheIfNeeded(cache, model, context); + for (const WithId& polygon : cache->polygons) { fn(polygon); } }