Moved uniforms setup after uniform cache flushing.

This commit is contained in:
Rinnegatamante
2020-10-18 23:29:03 +02:00
parent 0e347cbe5b
commit b3be1236c3
2 changed files with 4 additions and 14 deletions
+4 -4
View File
@@ -119,9 +119,9 @@ im2DRenderPrimitive(PrimitiveType primType, void *vertices, int32 numVertices)
else
im2dShader->use();
glUniform4fv(currentShader->uniformLocations[u_xform], 1, xform);
flushCache();
glUniform4fv(currentShader->uniformLocations[u_xform], 1, xform);
vglDrawObjects(primTypeMap[primType], numVertices, GL_FALSE);
}
@@ -153,9 +153,9 @@ im2DRenderIndexedPrimitive(PrimitiveType primType,
else
im2dShader->use();
glUniform4fv(currentShader->uniformLocations[u_xform], 1, xform);
flushCache();
glUniform4fv(currentShader->uniformLocations[u_xform], 1, xform);
vglDrawObjects(primTypeMap[primType], numIndices, GL_FALSE);
}
-10
View File
@@ -146,16 +146,6 @@ linkprogram(GLint vs, GLint fs, GLuint *program, bool is_2d)
glAttachShader(prog, vs);
glAttachShader(prog, fs);
#ifdef RW_GLES2
// TODO: perhaps just do this always and get rid of the layout stuff?
glBindAttribLocation(prog, ATTRIB_POS, "in_pos");
glBindAttribLocation(prog, ATTRIB_NORMAL, "in_normal");
glBindAttribLocation(prog, ATTRIB_COLOR, "in_color");
glBindAttribLocation(prog, ATTRIB_TEXCOORDS0, "in_tex0");
glBindAttribLocation(prog, ATTRIB_WEIGHTS, "in_weights");
glBindAttribLocation(prog, ATTRIB_INDICES, "in_indices");
#endif
int stride = 0;
int pos_size = is_2d ? 4 : 3;