Optimize uniform parsing;

By only parsing the first uniform in an array.
This commit is contained in:
bjorn 2019-01-11 12:27:40 -08:00
parent 305acb89a9
commit c85fd69079
1 changed files with 5 additions and 1 deletions

View File

@ -1713,7 +1713,11 @@ static void lovrShaderSetupUniforms(Shader* shader) {
char* subscript = strchr(uniform.name, '[');
if (subscript) {
*subscript = '\0';
if (subscript[1] > '0') {
continue;
} else {
*subscript = '\0';
}
}
uniform.location = glGetUniformLocation(program, uniform.name);