X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fvertexsetup.cpp;h=1094bb21c9ef229359a09f70b35435c32f6e8444;hp=da79e7f6135f9b3d06badf30e024903e7d5b280a;hb=2d3113a7dbbe4be2f1d1e8980c1c4e42175163da;hpb=c5583e23cc7b064ac28f2b2b6993d1e5fa415d5b diff --git a/source/core/vertexsetup.cpp b/source/core/vertexsetup.cpp index da79e7f6..1094bb21 100644 --- a/source/core/vertexsetup.cpp +++ b/source/core/vertexsetup.cpp @@ -7,6 +7,7 @@ #include #include #include "buffer.h" +#include "deviceinfo.h" #include "error.h" #include "gl.h" #include "misc.h" @@ -98,12 +99,10 @@ bool VertexSetup::verify_format(const VertexFormat &fmt) if(fmt.empty()) return false; - static int max_attribs = -1; - if(max_attribs<0) - max_attribs = get_i(GL_MAX_VERTEX_ATTRIBS); + unsigned max_attribs = Limits::get_global().max_vertex_attributes; for(const unsigned char *a=fmt.begin(); a!=fmt.end(); ++a) - if(static_cast(get_attribute_semantic(*a))>=max_attribs) + if(get_attribute_semantic(*a)>=max_attribs) return false; return true;