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
...@@ -1729,62 +1729,55 @@ namespace es2 ...@@ -1729,62 +1729,55 @@ namespace es2
return true; return true;
} }
bool Program::applyUniform1bv(GLint location, GLsizei count, const GLboolean *v) bool Program::applyUniform(GLint location, float* data)
{ {
int vector[MAX_UNIFORM_VECTORS][4];
for(int i = 0; i < count; i++)
{
vector[i][0] = (v[0] == GL_FALSE ? 0x00000000 : 0xFFFFFFFF);
vector[i][1] = 0;
vector[i][2] = 0;
vector[i][3] = 0;
v += 1;
}
Uniform *targetUniform = uniforms[uniformIndex[location].index]; Uniform *targetUniform = uniforms[uniformIndex[location].index];
if(targetUniform->psRegisterIndex != -1) if(targetUniform->psRegisterIndex != -1)
{ {
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount()); device->setPixelShaderConstantF(targetUniform->psRegisterIndex, data, targetUniform->registerCount());
} }
if(targetUniform->vsRegisterIndex != -1) if(targetUniform->vsRegisterIndex != -1)
{ {
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount()); device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, data, targetUniform->registerCount());
} }
return true; return true;
} }
bool Program::applyUniform2bv(GLint location, GLsizei count, const GLboolean *v) bool Program::applyUniform1bv(GLint location, GLsizei count, const GLboolean *v)
{ {
int vector[MAX_UNIFORM_VECTORS][4]; int vector[MAX_UNIFORM_VECTORS][4];
for(int i = 0; i < count; i++) for(int i = 0; i < count; i++)
{ {
vector[i][0] = (v[0] == GL_FALSE ? 0x00000000 : 0xFFFFFFFF); vector[i][0] = (v[0] == GL_FALSE ? 0x00000000 : 0xFFFFFFFF);
vector[i][1] = (v[1] == GL_FALSE ? 0x00000000 : 0xFFFFFFFF); vector[i][1] = 0;
vector[i][2] = 0; vector[i][2] = 0;
vector[i][3] = 0; vector[i][3] = 0;
v += 2; v += 1;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)vector);
}
if(targetUniform->psRegisterIndex != -1) bool Program::applyUniform2bv(GLint location, GLsizei count, const GLboolean *v)
{ {
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount()); int vector[MAX_UNIFORM_VECTORS][4];
}
if(targetUniform->vsRegisterIndex != -1) for(int i = 0; i < count; i++)
{ {
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount()); vector[i][0] = (v[0] == GL_FALSE ? 0x00000000 : 0xFFFFFFFF);
vector[i][1] = (v[1] == GL_FALSE ? 0x00000000 : 0xFFFFFFFF);
vector[i][2] = 0;
vector[i][3] = 0;
v += 2;
} }
return true; return applyUniform(location, (float*)vector);
} }
bool Program::applyUniform3bv(GLint location, GLsizei count, const GLboolean *v) bool Program::applyUniform3bv(GLint location, GLsizei count, const GLboolean *v)
...@@ -1801,19 +1794,7 @@ namespace es2 ...@@ -1801,19 +1794,7 @@ namespace es2
v += 3; v += 3;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)vector);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniform4bv(GLint location, GLsizei count, const GLboolean *v) bool Program::applyUniform4bv(GLint location, GLsizei count, const GLboolean *v)
...@@ -1830,19 +1811,7 @@ namespace es2 ...@@ -1830,19 +1811,7 @@ namespace es2
v += 4; v += 4;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)vector);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniform1fv(GLint location, GLsizei count, const GLfloat *v) bool Program::applyUniform1fv(GLint location, GLsizei count, const GLfloat *v)
...@@ -1859,19 +1828,7 @@ namespace es2 ...@@ -1859,19 +1828,7 @@ namespace es2
v += 1; v += 1;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)vector);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniform2fv(GLint location, GLsizei count, const GLfloat *v) bool Program::applyUniform2fv(GLint location, GLsizei count, const GLfloat *v)
...@@ -1888,19 +1845,7 @@ namespace es2 ...@@ -1888,19 +1845,7 @@ namespace es2
v += 2; v += 2;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)vector);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniform3fv(GLint location, GLsizei count, const GLfloat *v) bool Program::applyUniform3fv(GLint location, GLsizei count, const GLfloat *v)
...@@ -1917,36 +1862,12 @@ namespace es2 ...@@ -1917,36 +1862,12 @@ namespace es2
v += 3; v += 3;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)vector);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniform4fv(GLint location, GLsizei count, const GLfloat *v) bool Program::applyUniform4fv(GLint location, GLsizei count, const GLfloat *v)
{ {
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)v);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)v, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)v, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniformMatrix2fv(GLint location, GLsizei count, const GLfloat *value) bool Program::applyUniformMatrix2fv(GLint location, GLsizei count, const GLfloat *value)
...@@ -1961,19 +1882,7 @@ namespace es2 ...@@ -1961,19 +1882,7 @@ namespace es2
value += 4; value += 4;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)matrix);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniformMatrix2x3fv(GLint location, GLsizei count, const GLfloat *value) bool Program::applyUniformMatrix2x3fv(GLint location, GLsizei count, const GLfloat *value)
...@@ -1988,19 +1897,7 @@ namespace es2 ...@@ -1988,19 +1897,7 @@ namespace es2
value += 6; value += 6;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)matrix);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniformMatrix2x4fv(GLint location, GLsizei count, const GLfloat *value) bool Program::applyUniformMatrix2x4fv(GLint location, GLsizei count, const GLfloat *value)
...@@ -2015,19 +1912,7 @@ namespace es2 ...@@ -2015,19 +1912,7 @@ namespace es2
value += 8; value += 8;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)matrix);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniformMatrix3fv(GLint location, GLsizei count, const GLfloat *value) bool Program::applyUniformMatrix3fv(GLint location, GLsizei count, const GLfloat *value)
...@@ -2043,19 +1928,7 @@ namespace es2 ...@@ -2043,19 +1928,7 @@ namespace es2
value += 9; value += 9;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)matrix);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniformMatrix3x2fv(GLint location, GLsizei count, const GLfloat *value) bool Program::applyUniformMatrix3x2fv(GLint location, GLsizei count, const GLfloat *value)
...@@ -2071,19 +1944,7 @@ namespace es2 ...@@ -2071,19 +1944,7 @@ namespace es2
value += 6; value += 6;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)matrix);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniformMatrix3x4fv(GLint location, GLsizei count, const GLfloat *value) bool Program::applyUniformMatrix3x4fv(GLint location, GLsizei count, const GLfloat *value)
...@@ -2099,36 +1960,12 @@ namespace es2 ...@@ -2099,36 +1960,12 @@ namespace es2
value += 12; value += 12;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)matrix);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniformMatrix4fv(GLint location, GLsizei count, const GLfloat *value) bool Program::applyUniformMatrix4fv(GLint location, GLsizei count, const GLfloat *value)
{ {
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)value);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)value, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)value, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniformMatrix4x2fv(GLint location, GLsizei count, const GLfloat *value) bool Program::applyUniformMatrix4x2fv(GLint location, GLsizei count, const GLfloat *value)
...@@ -2145,19 +1982,7 @@ namespace es2 ...@@ -2145,19 +1982,7 @@ namespace es2
value += 8; value += 8;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)matrix);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniformMatrix4x3fv(GLint location, GLsizei count, const GLfloat *value) bool Program::applyUniformMatrix4x3fv(GLint location, GLsizei count, const GLfloat *value)
...@@ -2174,19 +1999,7 @@ namespace es2 ...@@ -2174,19 +1999,7 @@ namespace es2
value += 12; value += 12;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)matrix);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)matrix, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v) bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v)
...@@ -2202,10 +2015,9 @@ namespace es2 ...@@ -2202,10 +2015,9 @@ namespace es2
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; Uniform *targetUniform = uniforms[uniformIndex[location].index];
if(IsSamplerUniform(targetUniform->type))
if(targetUniform->psRegisterIndex != -1)
{ {
if(IsSamplerUniform(targetUniform->type)) if(targetUniform->psRegisterIndex != -1)
{ {
for(int i = 0; i < count; i++) for(int i = 0; i < count; i++)
{ {
...@@ -2218,15 +2030,8 @@ namespace es2 ...@@ -2218,15 +2030,8 @@ namespace es2
} }
} }
} }
else
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
}
if(targetUniform->vsRegisterIndex != -1) if(targetUniform->vsRegisterIndex != -1)
{
if(IsSamplerUniform(targetUniform->type))
{ {
for(int i = 0; i < count; i++) for(int i = 0; i < count; i++)
{ {
...@@ -2239,10 +2044,10 @@ namespace es2 ...@@ -2239,10 +2044,10 @@ namespace es2
} }
} }
} }
else }
{ else
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount()); {
} return applyUniform(location, (float*)vector);
} }
return true; return true;
...@@ -2262,19 +2067,7 @@ namespace es2 ...@@ -2262,19 +2067,7 @@ namespace es2
v += 2; v += 2;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)vector);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniform3iv(GLint location, GLsizei count, const GLint *v) bool Program::applyUniform3iv(GLint location, GLsizei count, const GLint *v)
...@@ -2291,19 +2084,7 @@ namespace es2 ...@@ -2291,19 +2084,7 @@ namespace es2
v += 3; v += 3;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)vector);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniform4iv(GLint location, GLsizei count, const GLint *v) bool Program::applyUniform4iv(GLint location, GLsizei count, const GLint *v)
...@@ -2320,19 +2101,7 @@ namespace es2 ...@@ -2320,19 +2101,7 @@ namespace es2
v += 4; v += 4;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)vector);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniform1uiv(GLint location, GLsizei count, const GLuint *v) bool Program::applyUniform1uiv(GLint location, GLsizei count, const GLuint *v)
...@@ -2348,10 +2117,9 @@ namespace es2 ...@@ -2348,10 +2117,9 @@ namespace es2
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; Uniform *targetUniform = uniforms[uniformIndex[location].index];
if(IsSamplerUniform(targetUniform->type))
if(targetUniform->psRegisterIndex != -1)
{ {
if(IsSamplerUniform(targetUniform->type)) if(targetUniform->psRegisterIndex != -1)
{ {
for(int i = 0; i < count; i++) for(int i = 0; i < count; i++)
{ {
...@@ -2364,15 +2132,8 @@ namespace es2 ...@@ -2364,15 +2132,8 @@ namespace es2
} }
} }
} }
else
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
}
if(targetUniform->vsRegisterIndex != -1) if(targetUniform->vsRegisterIndex != -1)
{
if(IsSamplerUniform(targetUniform->type))
{ {
for(int i = 0; i < count; i++) for(int i = 0; i < count; i++)
{ {
...@@ -2385,10 +2146,10 @@ namespace es2 ...@@ -2385,10 +2146,10 @@ namespace es2
} }
} }
} }
else }
{ else
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount()); {
} return applyUniform(location, (float*)vector);
} }
return true; return true;
...@@ -2408,19 +2169,7 @@ namespace es2 ...@@ -2408,19 +2169,7 @@ namespace es2
v += 2; v += 2;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)vector);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniform3uiv(GLint location, GLsizei count, const GLuint *v) bool Program::applyUniform3uiv(GLint location, GLsizei count, const GLuint *v)
...@@ -2437,19 +2186,7 @@ namespace es2 ...@@ -2437,19 +2186,7 @@ namespace es2
v += 3; v += 3;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)vector);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount());
}
return true;
} }
bool Program::applyUniform4uiv(GLint location, GLsizei count, const GLuint *v) bool Program::applyUniform4uiv(GLint location, GLsizei count, const GLuint *v)
...@@ -2466,19 +2203,7 @@ namespace es2 ...@@ -2466,19 +2203,7 @@ namespace es2
v += 4; v += 4;
} }
Uniform *targetUniform = uniforms[uniformIndex[location].index]; return applyUniform(location, (float*)vector);
if(targetUniform->psRegisterIndex != -1)
{
device->setPixelShaderConstantF(targetUniform->psRegisterIndex, (float*)vector, targetUniform->registerCount());
}
if(targetUniform->vsRegisterIndex != -1)
{
device->setVertexShaderConstantF(targetUniform->vsRegisterIndex, (float*)vector, targetUniform->registerCount());
}
return true;
} }
void Program::appendToInfoLog(const char *format, ...) void Program::appendToInfoLog(const char *format, ...)
......
...@@ -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