diff options
author | Geoff Lang <geofflang@chromium.org> | 2014-09-16 14:10:02 -0400 |
---|---|---|
committer | Geoff Lang <geofflang@chromium.org> | 2014-09-17 20:03:47 +0000 |
commit | 61f541802f0aecd106f8feaf4ef6dd003cc4aee9 (patch) | |
tree | 50a52f1b1cf7e86a6136d4d4879f971852e3bec9 | |
parent | 08a59f85d2b9788381a1095d231a6c3fe46a1373 (diff) | |
download | angle-61f541802f0aecd106f8feaf4ef6dd003cc4aee9.tar.gz |
Don't modify the function parameters in ProgramBinary::setUniform.
BUG=414450
Change-Id: Ib5ebf18e57af671b8694ffcfc3cb152557f7f002
Reviewed-on: https://chromium-review.googlesource.com/218500
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
-rw-r--r-- | src/libGLESv2/ProgramBinary.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/libGLESv2/ProgramBinary.cpp b/src/libGLESv2/ProgramBinary.cpp index 2355352f..299ed94a 100644 --- a/src/libGLESv2/ProgramBinary.cpp +++ b/src/libGLESv2/ProgramBinary.cpp @@ -572,16 +572,17 @@ void ProgramBinary::setUniform(GLint location, GLsizei count, const T* v, GLenum for (int i = 0; i < count; i++) { + T *dest = target + (i * 4); + const T *source = v + (i * components); + for (int c = 0; c < components; c++) { - SetIfDirty(target + c, v[c], &targetUniform->dirty); + SetIfDirty(dest + c, source[c], &targetUniform->dirty); } for (int c = components; c < 4; c++) { - SetIfDirty(target + c, T(0), &targetUniform->dirty); + SetIfDirty(dest + c, T(0), &targetUniform->dirty); } - target += 4; - v += components; } } else if (targetUniform->type == targetBoolType) @@ -590,16 +591,17 @@ void ProgramBinary::setUniform(GLint location, GLsizei count, const T* v, GLenum for (int i = 0; i < count; i++) { + GLint *dest = boolParams + (i * 4); + const T *source = v + (i * components); + for (int c = 0; c < components; c++) { - SetIfDirty(boolParams + c, (v[c] == static_cast<T>(0)) ? GL_FALSE : GL_TRUE, &targetUniform->dirty); + SetIfDirty(dest + c, (source[c] == static_cast<T>(0)) ? GL_FALSE : GL_TRUE, &targetUniform->dirty); } for (int c = components; c < 4; c++) { - SetIfDirty(boolParams + c, GL_FALSE, &targetUniform->dirty); + SetIfDirty(dest + c, GL_FALSE, &targetUniform->dirty); } - boolParams += 4; - v += components; } } else UNREACHABLE(); |