Moved uniforms setup after uniform cache flushing.
This commit is contained in:
+4
-4
@@ -119,9 +119,9 @@ im2DRenderPrimitive(PrimitiveType primType, void *vertices, int32 numVertices)
|
|||||||
else
|
else
|
||||||
im2dShader->use();
|
im2dShader->use();
|
||||||
|
|
||||||
glUniform4fv(currentShader->uniformLocations[u_xform], 1, xform);
|
|
||||||
|
|
||||||
flushCache();
|
flushCache();
|
||||||
|
glUniform4fv(currentShader->uniformLocations[u_xform], 1, xform);
|
||||||
|
|
||||||
vglDrawObjects(primTypeMap[primType], numVertices, GL_FALSE);
|
vglDrawObjects(primTypeMap[primType], numVertices, GL_FALSE);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -153,9 +153,9 @@ im2DRenderIndexedPrimitive(PrimitiveType primType,
|
|||||||
else
|
else
|
||||||
im2dShader->use();
|
im2dShader->use();
|
||||||
|
|
||||||
glUniform4fv(currentShader->uniformLocations[u_xform], 1, xform);
|
|
||||||
|
|
||||||
flushCache();
|
flushCache();
|
||||||
|
glUniform4fv(currentShader->uniformLocations[u_xform], 1, xform);
|
||||||
|
|
||||||
vglDrawObjects(primTypeMap[primType], numIndices, GL_FALSE);
|
vglDrawObjects(primTypeMap[primType], numIndices, GL_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,16 +146,6 @@ linkprogram(GLint vs, GLint fs, GLuint *program, bool is_2d)
|
|||||||
|
|
||||||
glAttachShader(prog, vs);
|
glAttachShader(prog, vs);
|
||||||
glAttachShader(prog, fs);
|
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 stride = 0;
|
||||||
int pos_size = is_2d ? 4 : 3;
|
int pos_size = is_2d ? 4 : 3;
|
||||||
|
|||||||
Reference in New Issue
Block a user