From: Mikko Rasa Date: Sun, 9 Feb 2020 21:53:24 +0000 (+0200) Subject: Don't call glVertexAttribDivisor if the extension is not available X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=746358b723bdb1ed71584d6fd28f783feb434aef;p=libs%2Fgl.git Don't call glVertexAttribDivisor if the extension is not available --- diff --git a/source/vertexsetup.cpp b/source/vertexsetup.cpp index 7cfc1b6d..19edfb39 100644 --- a/source/vertexsetup.cpp +++ b/source/vertexsetup.cpp @@ -126,7 +126,8 @@ void VertexSetup::update_vertex_array(const VertexArray &array, unsigned binding glVertexAttribPointer(t, 4, GL_UNSIGNED_BYTE, true, stride, reinterpret_cast(offset)); else glVertexAttribPointer(t, sz, GL_FLOAT, false, stride, reinterpret_cast(offset)); - glVertexAttribDivisor(t, divisor); + if(ARB_instanced_arrays) + glVertexAttribDivisor(t, divisor); glEnableVertexAttribArray(t); } offset += sz*sizeof(float);