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,14 +1659,15 @@ bool Program::defineUniform(const D3DXHANDLE &constantHandle, const D3DXCONSTANT ...@@ -1659,14 +1659,15 @@ bool Program::defineUniform(const D3DXHANDLE &constantHandle, const D3DXCONSTANT
{ {
if (constantDescription.RegisterSet == D3DXRS_SAMPLER) if (constantDescription.RegisterSet == D3DXRS_SAMPLER)
{ {
unsigned int samplerIndex = constantDescription.RegisterIndex; for (unsigned int samplerIndex = constantDescription.RegisterIndex; samplerIndex < constantDescription.RegisterIndex + constantDescription.RegisterCount; samplerIndex++)
{
assert(samplerIndex < sizeof(mSamplers)/sizeof(mSamplers[0])); ASSERT(samplerIndex < sizeof(mSamplers)/sizeof(mSamplers[0]));
mSamplers[samplerIndex].active = true; mSamplers[samplerIndex].active = true;
mSamplers[samplerIndex].type = (constantDescription.Type == D3DXPT_SAMPLERCUBE) ? SAMPLER_CUBE : SAMPLER_2D; mSamplers[samplerIndex].type = (constantDescription.Type == D3DXPT_SAMPLERCUBE) ? SAMPLER_CUBE : SAMPLER_2D;
mSamplers[samplerIndex].logicalTextureUnit = 0; mSamplers[samplerIndex].logicalTextureUnit = 0;
mSamplers[samplerIndex].dirty = true; mSamplers[samplerIndex].dirty = true;
}
} }
switch(constantDescription.Class) 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