- VertexFormat r=f;
- unsigned char *c=r.data+r.data[0];
- if(*c<ATTRIB1)
- throw InvalidState("Last component is not a generic attribute");
- // VertexArray uses an unsigned to store flags for enabled arrays
- if(i>=28)
- throw InvalidParameterValue("Generic attribute index out of range");
- *c+=i*4;
+ VertexFormat r = f;
+ unsigned char *c = r.data+r.data[0];
+ if((*c<TEXCOORD1 && i>0) || (*c<ATTRIB1 && i>=8) || i>=53)
+ throw InvalidParameterValue("Vertex component index out of range");
+ *c += i*4;