Fix support for arrays of samplers.

TRAC #14840 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@507 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 5efd8b45
......@@ -1659,15 +1659,16 @@ bool Program::defineUniform(const D3DXHANDLE &constantHandle, const D3DXCONSTANT
{
if (constantDescription.RegisterSet == D3DXRS_SAMPLER)
{
unsigned int samplerIndex = constantDescription.RegisterIndex;
assert(samplerIndex < sizeof(mSamplers)/sizeof(mSamplers[0]));
for (unsigned int samplerIndex = constantDescription.RegisterIndex; samplerIndex < constantDescription.RegisterIndex + constantDescription.RegisterCount; samplerIndex++)
{
ASSERT(samplerIndex < sizeof(mSamplers)/sizeof(mSamplers[0]));
mSamplers[samplerIndex].active = true;
mSamplers[samplerIndex].type = (constantDescription.Type == D3DXPT_SAMPLERCUBE) ? SAMPLER_CUBE : SAMPLER_2D;
mSamplers[samplerIndex].logicalTextureUnit = 0;
mSamplers[samplerIndex].dirty = true;
}
}
switch(constantDescription.Class)
{
......
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