summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/context.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-02-17 10:09:49 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-02-20 08:24:42 -0800
commit4e752f63b94b71d901a1933a1bb121332fffe96b (patch)
tree3d94e81332b9ec66219ae15a08bf2b6c519dc069 /src/mbgl/gl/context.cpp
parentf8ab327874d32c77e591be82fd46c8cb741c130c (diff)
downloadqtlocation-mapboxgl-4e752f63b94b71d901a1933a1bb121332fffe96b.tar.gz
[core] Redo approach to unsupported VAO extension
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r--src/mbgl/gl/context.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index 5726eca5dc..9c2031ccfd 100644
--- a/src/mbgl/gl/context.cpp
+++ b/src/mbgl/gl/context.cpp
@@ -122,17 +122,17 @@ UniqueTexture Context::createTexture() {
return UniqueTexture{ std::move(id), { this } };
}
+bool Context::supportsVertexArrays() const {
+ return gl::GenVertexArrays &&
+ gl::BindVertexArray &&
+ gl::DeleteVertexArrays &&
+ !disableVAOExtension;
+}
+
UniqueVertexArray Context::createVertexArray() {
+ assert(supportsVertexArrays());
VertexArrayID id = 0;
- if (gl::GenVertexArrays && !disableVAOExtension) {
- MBGL_CHECK_ERROR(gl::GenVertexArrays(1, &id));
- } else {
- static bool reported = false;
- if (!reported) {
- Log::Warning(Event::OpenGL, "Not using Vertex Array Objects");
- reported = true;
- }
- }
+ MBGL_CHECK_ERROR(gl::GenVertexArrays(1, &id));
return UniqueVertexArray(std::move(id), { this });
}
@@ -529,6 +529,7 @@ void Context::performCleanup() {
}
if (!abandonedVertexArrays.empty()) {
+ assert(supportsVertexArrays());
for (const auto id : abandonedVertexArrays) {
if (vertexArrayObject == id) {
vertexArrayObject.setDirty();