diff options
-rw-r--r-- | src/mbgl/renderer/buckets/debug_bucket.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/symbol_bucket.cpp | 13 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/mbgl/renderer/buckets/debug_bucket.cpp b/src/mbgl/renderer/buckets/debug_bucket.cpp index 7b2f5c05ed..dac7622996 100644 --- a/src/mbgl/renderer/buckets/debug_bucket.cpp +++ b/src/mbgl/renderer/buckets/debug_bucket.cpp @@ -78,8 +78,10 @@ DebugBucket::DebugBucket(const OverscaledTileID& id, segments.emplace_back(0, 0, vertices.elements(), indices.elements()); - vertexBuffer = context.createVertexBuffer(std::move(vertices)); - indexBuffer = context.createIndexBuffer(std::move(indices)); + if (!vertices.empty()) { + vertexBuffer = context.createVertexBuffer(std::move(vertices)); + indexBuffer = context.createIndexBuffer(std::move(indices)); + } } } // namespace mbgl diff --git a/src/mbgl/renderer/buckets/symbol_bucket.cpp b/src/mbgl/renderer/buckets/symbol_bucket.cpp index 243cd4ebce..fb5a38f913 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.cpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.cpp @@ -48,6 +48,9 @@ void SymbolBucket::upload(gfx::Context& context) { if (!staticUploaded) { text.indexBuffer = context.createIndexBuffer(std::move(text.triangles), sortFeaturesByY ? gfx::BufferUsageType::StreamDraw : gfx::BufferUsageType::StaticDraw); text.vertexBuffer = context.createVertexBuffer(std::move(text.vertices)); + for (auto& pair : paintProperties) { + pair.second.textBinders.upload(context); + } } else if (!sortUploaded) { context.updateIndexBuffer(*text.indexBuffer, std::move(text.triangles)); } @@ -68,6 +71,9 @@ void SymbolBucket::upload(gfx::Context& context) { if (!staticUploaded) { icon.indexBuffer = context.createIndexBuffer(std::move(icon.triangles), sortFeaturesByY ? gfx::BufferUsageType::StreamDraw : gfx::BufferUsageType::StaticDraw); icon.vertexBuffer = context.createVertexBuffer(std::move(icon.vertices)); + for (auto& pair : paintProperties) { + pair.second.iconBinders.upload(context); + } } else if (!sortUploaded) { context.updateIndexBuffer(*icon.indexBuffer, std::move(icon.triangles)); } @@ -111,13 +117,6 @@ void SymbolBucket::upload(gfx::Context& context) { } } - if (!staticUploaded) { - for (auto& pair : paintProperties) { - pair.second.iconBinders.upload(context); - pair.second.textBinders.upload(context); - } - } - uploaded = true; staticUploaded = true; placementChangesUploaded = true; |