summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mbgl/renderer/debug_bucket.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mbgl/renderer/debug_bucket.cpp b/src/mbgl/renderer/debug_bucket.cpp
index 947783ddb8..ba4ab8c928 100644
--- a/src/mbgl/renderer/debug_bucket.cpp
+++ b/src/mbgl/renderer/debug_bucket.cpp
@@ -31,11 +31,15 @@ DebugBucket::DebugBucket(const TileID id, const TileData::State state_, optional
}
void DebugBucket::drawLines(PlainShader& shader, gl::GLObjectStore& glObjectStore) {
- array.bind(shader, fontBuffer, BUFFER_OFFSET_0, glObjectStore);
- MBGL_CHECK_ERROR(glDrawArrays(GL_LINES, 0, (GLsizei)(fontBuffer.index())));
+ if (!fontBuffer.empty()) {
+ array.bind(shader, fontBuffer, BUFFER_OFFSET_0, glObjectStore);
+ MBGL_CHECK_ERROR(glDrawArrays(GL_LINES, 0, (GLsizei)(fontBuffer.index())));
+ }
}
void DebugBucket::drawPoints(PlainShader& shader, gl::GLObjectStore& glObjectStore) {
- array.bind(shader, fontBuffer, BUFFER_OFFSET_0, glObjectStore);
- MBGL_CHECK_ERROR(glDrawArrays(GL_POINTS, 0, (GLsizei)(fontBuffer.index())));
+ if (!fontBuffer.empty()) {
+ array.bind(shader, fontBuffer, BUFFER_OFFSET_0, glObjectStore);
+ MBGL_CHECK_ERROR(glDrawArrays(GL_POINTS, 0, (GLsizei)(fontBuffer.index())));
+ }
}