Prevent redundant uniform updates
TRAC #12154
Signed-off-by: Shannon Woods
Signed-off-by: Daniel Koch
Author: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/trunk@255 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Program.h b/src/libGLESv2/Program.h
index d2ee931..a1ddd98 100644
--- a/src/libGLESv2/Program.h
+++ b/src/libGLESv2/Program.h
@@ -33,7 +33,9 @@
const GLenum type;
const std::string name;
const unsigned int arraySize;
+
unsigned char *data;
+ bool dirty;
};
// Struct used for correlating uniforms/elements of uniform arrays to handles
@@ -83,6 +85,7 @@
bool getUniformfv(GLint location, GLfloat *params);
bool getUniformiv(GLint location, GLint *params);
+ void dirtyAllUniforms();
void applyUniforms();
void link();
@@ -106,6 +109,8 @@
bool validateSamplers() const;
bool isValidated() const;
+ unsigned int getSerial() const;
+
private:
DISALLOW_COPY_AND_ASSIGN(Program);
@@ -158,6 +163,8 @@
static std::string decorate(const std::string &string); // Prepend an underscore
static std::string undecorate(const std::string &string); // Remove leading underscore
+ static unsigned int issueSerial();
+
FragmentShader *mFragmentShader;
VertexShader *mVertexShader;
@@ -191,6 +198,10 @@
bool mDeleteStatus; // Flag to indicate that the program can be deleted when no longer in use
char *mInfoLog;
bool mValidated;
+
+ unsigned int mSerial;
+
+ static unsigned int mCurrentSerial;
};
}