Commit 773b67af by Alexis Hetu Committed by Alexis Hétu

Program cleanup

Working on uniforms, I realized that there was a large amount of code duplication in the applyUniform* functions, so I create a basic applyUniform() to contain common code between all these functions, which reduces the size of Program.cpp by about 275 lines, or about 10% of that file. Change-Id: I0f013821e1cc8f507bb4d6829b0097fc41420e6d Reviewed-on: https://swiftshader-review.googlesource.com/4527Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent bdda9dac
...@@ -225,6 +225,7 @@ namespace es2 ...@@ -225,6 +225,7 @@ namespace es2
bool areMatchingUniformBlocks(const glsl::UniformBlock &block1, const glsl::UniformBlock &block2, const Shader *shader1, const Shader *shader2); bool areMatchingUniformBlocks(const glsl::UniformBlock &block1, const glsl::UniformBlock &block2, const Shader *shader1, const Shader *shader2);
bool defineUniform(GLenum shader, GLenum type, GLenum precision, const std::string &_name, unsigned int arraySize, int registerIndex, const Uniform::BlockInfo& blockInfo); bool defineUniform(GLenum shader, GLenum type, GLenum precision, const std::string &_name, unsigned int arraySize, int registerIndex, const Uniform::BlockInfo& blockInfo);
bool defineUniformBlock(const Shader *shader, const glsl::UniformBlock &block); bool defineUniformBlock(const Shader *shader, const glsl::UniformBlock &block);
bool applyUniform(GLint location, float* data);
bool applyUniform1bv(GLint location, GLsizei count, const GLboolean *v); bool applyUniform1bv(GLint location, GLsizei count, const GLboolean *v);
bool applyUniform2bv(GLint location, GLsizei count, const GLboolean *v); bool applyUniform2bv(GLint location, GLsizei count, const GLboolean *v);
bool applyUniform3bv(GLint location, GLsizei count, const GLboolean *v); bool applyUniform3bv(GLint location, GLsizei count, const GLboolean *v);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment