]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/vertexformat.cpp
Move checking of vertex attribute indices to VertexSetup
[libs/gl.git] / source / core / vertexformat.cpp
index 65bbea49887ad82f1cdf4097204861bba79e197b..908da99278defda2530f699aef308a90d116e99e 100644 (file)
@@ -3,9 +3,7 @@
 #include <msp/strings/lexicalcast.h>
 #include <msp/strings/utils.h>
 #include "error.h"
 #include <msp/strings/lexicalcast.h>
 #include <msp/strings/utils.h>
 #include "error.h"
-#include "misc.h"
 #include "vertexformat.h"
 #include "vertexformat.h"
-#include <msp/gl/extensions/arb_vertex_shader.h>
 
 using namespace std;
 
 
 using namespace std;
 
@@ -95,11 +93,7 @@ VertexAttribute make_indexed_attribute(VertexAttribute attr, unsigned index)
        else if(attr<GENERIC1 || attr>GENERIC4)
                throw invalid_argument("make_indexed_attribute");
 
        else if(attr<GENERIC1 || attr>GENERIC4)
                throw invalid_argument("make_indexed_attribute");
 
-       static int max_attribs = -1;
-       if(max_attribs<0)
-               max_attribs = get_i(GL_MAX_VERTEX_ATTRIBS);
-
-       if(static_cast<int>((base>>3)+index)>=max_attribs)
+       if(static_cast<int>((base>>3)+index)>=31)
                throw out_of_range("make_indexed_attribute");
 
        return static_cast<VertexAttribute>(base+index*8);
                throw out_of_range("make_indexed_attribute");
 
        return static_cast<VertexAttribute>(base+index*8);