Consider out-of-range texture units to be incomplete.

TRAC #12224 Signed-off-by: Shannon Woods Signed-off-by: Daniel Koch Author: Andrew Lewycky git-svn-id: https://angleproject.googlecode.com/svn/trunk@271 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent a71cdd7c
...@@ -190,9 +190,16 @@ GLint Program::getSamplerMapping(unsigned int samplerIndex) ...@@ -190,9 +190,16 @@ GLint Program::getSamplerMapping(unsigned int samplerIndex)
{ {
assert(samplerIndex < sizeof(mSamplers)/sizeof(mSamplers[0])); assert(samplerIndex < sizeof(mSamplers)/sizeof(mSamplers[0]));
GLint logicalTextureUnit = -1;
if (mSamplers[samplerIndex].active) if (mSamplers[samplerIndex].active)
{ {
return mSamplers[samplerIndex].logicalTextureUnit; logicalTextureUnit = mSamplers[samplerIndex].logicalTextureUnit;
}
if (logicalTextureUnit < MAX_TEXTURE_IMAGE_UNITS)
{
return logicalTextureUnit;
} }
return -1; return -1;
...@@ -1816,14 +1823,11 @@ bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v) ...@@ -1816,14 +1823,11 @@ bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v)
{ {
GLint mappedSampler = v[0]; GLint mappedSampler = v[0];
if (mappedSampler >= 0 && mappedSampler < MAX_TEXTURE_IMAGE_UNITS) if (samplerIndex >= 0 && samplerIndex < MAX_TEXTURE_IMAGE_UNITS)
{ {
if (samplerIndex >= 0 && samplerIndex < MAX_TEXTURE_IMAGE_UNITS) ASSERT(mSamplers[samplerIndex].active);
{ mSamplers[samplerIndex].logicalTextureUnit = mappedSampler;
ASSERT(mSamplers[samplerIndex].active); mSamplers[samplerIndex].dirty = true;
mSamplers[samplerIndex].logicalTextureUnit = mappedSampler;
mSamplers[samplerIndex].dirty = true;
}
} }
} }
......
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