]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't call glVertexAttribDivisor if the extension is not available
authorMikko Rasa <tdb@tdb.fi>
Sun, 9 Feb 2020 21:53:24 +0000 (23:53 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 9 Feb 2020 21:53:24 +0000 (23:53 +0200)
source/vertexsetup.cpp

index 7cfc1b6d99499c34ba3831f63495cc109921dba5..19edfb39e4a6da0b2ddfe6a0d5566d8d27c56254 100644 (file)
@@ -126,7 +126,8 @@ void VertexSetup::update_vertex_array(const VertexArray &array, unsigned binding
                                glVertexAttribPointer(t, 4, GL_UNSIGNED_BYTE, true, stride, reinterpret_cast<unsigned char *>(offset));
                        else
                                glVertexAttribPointer(t, sz, GL_FLOAT, false, stride, reinterpret_cast<float *>(offset));
-                       glVertexAttribDivisor(t, divisor);
+                       if(ARB_instanced_arrays)
+                               glVertexAttribDivisor(t, divisor);
                        glEnableVertexAttribArray(t);
                }
                offset += sz*sizeof(float);