Remove unnecessary allocation in GLShader::setUniform(int, const QMatrix4x4 &)
We were creating a vector just to copy it over. We can pass the original vector just as well.
This commit is contained in:
parent
097caa64a5
commit
13dcb46888
1 changed files with 1 additions and 7 deletions
|
@ -471,13 +471,7 @@ bool GLShader::setUniform(int location, const QVector4D &value)
|
|||
bool GLShader::setUniform(int location, const QMatrix4x4 &value)
|
||||
{
|
||||
if (location >= 0) {
|
||||
GLfloat m[16];
|
||||
const auto *data = value.constData();
|
||||
// i is column, j is row for m
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
m[i] = data[i];
|
||||
}
|
||||
glUniformMatrix4fv(location, 1, GL_FALSE, m);
|
||||
glUniformMatrix4fv(location, 1, GL_FALSE, value.constData());
|
||||
}
|
||||
return (location >= 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue