Prevent redundant shader uniform uploads for built-in uniforms when OpenGL ES 2 is used.

As a result, the graphics primitive drawing functions (e.g. love.graphics.rectangle) are now more efficient on mobile devices.
This commit is contained in:
Alex Szpakowski
2015-06-24 22:04:19 -03:00
parent 88c8e0c071
commit 4c571e8fd7
3 changed files with 82 additions and 92 deletions
+5 -3
View File
@@ -180,11 +180,10 @@ public:
* Internal use only.
**/
bool hasVertexAttrib(VertexAttribID attrib) const;
bool hasBuiltinUniform(BuiltinUniform builtin) const;
bool sendBuiltinMatrix(BuiltinUniform builtin, int size, const GLfloat *m, int count);
bool sendBuiltinFloat(BuiltinUniform builtin, int size, const GLfloat *m, int count);
void checkSetScreenParams();
void checkSetPointSize(float size);
void checkSetBuiltinUniforms();
const std::map<std::string, Object *> &getBoundRetainables() const;
@@ -260,6 +259,9 @@ private:
float lastPointSize;
Matrix lastTransformMatrix;
Matrix lastProjectionMatrix;
// Counts total number of textures bound to each texture unit in all shaders
static std::vector<int> textureCounters;