Check GL_MAX_VERTEX_ATTRIBS on apply as well as fetch

This commit is contained in:
baldurk
2014-11-10 23:13:20 +00:00
parent 77a5d9d7b5
commit 060801db20
+3 -1
View File
@@ -301,7 +301,9 @@ void GLRenderState::ApplyState()
// See FetchState(). The spec says that you have to SET the right format for the shader too,
// but we couldn't query for the format so we can't set it here.
for(GLuint i=0; i < (GLuint)ARRAY_COUNT(GenericVertexAttribs); i++)
GLuint maxNumAttribs = 0;
m_Real->glGetIntegerv(eGL_MAX_VERTEX_ATTRIBS, (GLint *)&maxNumAttribs);
for(GLuint i=0; i < RDCMAX(maxNumAttribs, (GLuint)ARRAY_COUNT(GenericVertexAttribs)); i++)
m_Real->glVertexAttrib4fv(i, &GenericVertexAttribs[i].x);
m_Real->glPointParameterf(eGL_POINT_FADE_THRESHOLD_SIZE, PointFadeThresholdSize);