]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/vertexsetup.cpp
Store implementation limits in a central struct
[libs/gl.git] / source / core / vertexsetup.cpp
index da79e7f6135f9b3d06badf30e024903e7d5b280a..1094bb21c9ef229359a09f70b35435c32f6e8444 100644 (file)
@@ -7,6 +7,7 @@
 #include <msp/gl/extensions/arb_vertex_shader.h>
 #include <msp/gl/extensions/khr_debug.h>
 #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<int>(get_attribute_semantic(*a))>=max_attribs)
+               if(get_attribute_semantic(*a)>=max_attribs)
                        return false;
 
        return true;