Moved uniforms setup after uniform cache flushing.
This commit is contained in:
+2
-2
@@ -119,9 +119,9 @@ im2DRenderPrimitive(PrimitiveType primType, void *vertices, int32 numVertices)
|
||||
else
|
||||
im2dShader->use();
|
||||
|
||||
flushCache();
|
||||
glUniform4fv(currentShader->uniformLocations[u_xform], 1, xform);
|
||||
|
||||
flushCache();
|
||||
vglDrawObjects(primTypeMap[primType], numVertices, GL_FALSE);
|
||||
|
||||
}
|
||||
@@ -153,9 +153,9 @@ im2DRenderIndexedPrimitive(PrimitiveType primType,
|
||||
else
|
||||
im2dShader->use();
|
||||
|
||||
flushCache();
|
||||
glUniform4fv(currentShader->uniformLocations[u_xform], 1, xform);
|
||||
|
||||
flushCache();
|
||||
vglDrawObjects(primTypeMap[primType], numIndices, GL_FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -147,16 +147,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;
|
||||
stride += vglBindPackedAttribLocation(prog, "in_pos" , pos_size, GL_FLOAT, stride, stride + sizeof(float) * pos_size) * (sizeof(float) * pos_size);
|
||||
|
||||
Reference in New Issue
Block a user