Commits

Alex Szpakowski  committed 92b1b56

Fixed an attempted creation of an array with a constant size of 0

  • Participants
  • Parent commits cb9ae29

Comments (0)

Files changed (1)

File src/modules/graphics/opengl/Shader.cpp

 	// Bind generic vertex attribute indices to names in the shader.
 	for (int i = 0; i < int(OpenGL::ATTRIB_MAX_ENUM); i++)
 	{
+		OpenGL::VertexAttrib attrib = (OpenGL::VertexAttrib) i;
+
+		// FIXME: We skip this both because pseudo-instancing is temporarily
+		// disabled (see graphics.lua), and because binding a non-existant
+		// attribute name to a location causes a shader linker warning.
+		if (attrib == OpenGL::ATTRIB_PSEUDO_INSTANCE_ID)
+			continue;
+
 		const char *name = nullptr;
-		if (attribNames.find((OpenGL::VertexAttrib) i, name))
+		if (attribNames.find(attrib, name))
 			glBindAttribLocation(program, i, (const GLchar *) name);
 	}
 
 
 StringMap<OpenGL::VertexAttrib, OpenGL::ATTRIB_MAX_ENUM>::Entry Shader::attribNameEntries[] =
 {
-//	{"love_PseudoInstanceID", OpenGL::ATTRIB_PSEUDO_INSTANCE_ID},
+	{"love_PseudoInstanceID", OpenGL::ATTRIB_PSEUDO_INSTANCE_ID},
 };
 
 StringMap<OpenGL::VertexAttrib, OpenGL::ATTRIB_MAX_ENUM> Shader::attribNames(Shader::attribNameEntries, sizeof(Shader::attribNameEntries));