Commit 4c5ff005 by Corentin Wallez Committed by Commit Bot

ProgramGL: correctly copy sampler uniforms

BUG=angleproject:1570 Change-Id: Ic39f5f1ff8f565b2876fdfc8d738a50f24b911b6 Reviewed-on: https://chromium-review.googlesource.com/402930Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent cd2ed608
...@@ -223,7 +223,7 @@ void ProgramGL::setUniform1iv(GLint location, GLsizei count, const GLint *v) ...@@ -223,7 +223,7 @@ void ProgramGL::setUniform1iv(GLint location, GLsizei count, const GLint *v)
std::vector<GLuint> &boundTextureUnits = mSamplerBindings[samplerIndex].boundTextureUnits; std::vector<GLuint> &boundTextureUnits = mSamplerBindings[samplerIndex].boundTextureUnits;
size_t copyCount = size_t copyCount =
std::max<size_t>(count, boundTextureUnits.size() - locationEntry.element); std::min<size_t>(count, boundTextureUnits.size() - locationEntry.element);
std::copy(v, v + copyCount, boundTextureUnits.begin() + locationEntry.element); std::copy(v, v + copyCount, boundTextureUnits.begin() + locationEntry.element);
} }
} }
......
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