Fixed vertex sampler index retrieval.

TRAC #18865 ANGLEBUG=247 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@880 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 1625d7d4
#define MAJOR_VERSION 0 #define MAJOR_VERSION 0
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 879 #define BUILD_REVISION 880
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -1854,10 +1854,15 @@ bool Program::defineUniform(const D3DXHANDLE &constantHandle, const D3DXCONSTANT ...@@ -1854,10 +1854,15 @@ bool Program::defineUniform(const D3DXHANDLE &constantHandle, const D3DXCONSTANT
{ {
if (constantDescription.RegisterSet == D3DXRS_SAMPLER) if (constantDescription.RegisterSet == D3DXRS_SAMPLER)
{ {
for (unsigned int samplerIndex = constantDescription.RegisterIndex; samplerIndex < constantDescription.RegisterIndex + constantDescription.RegisterCount; samplerIndex++) for (unsigned int i = 0; i < constantDescription.RegisterCount; i++)
{ {
if (mConstantTablePS->GetConstantByName(NULL, constantDescription.Name) != NULL) D3DXHANDLE psConstant = mConstantTablePS->GetConstantByName(NULL, constantDescription.Name);
D3DXHANDLE vsConstant = mConstantTableVS->GetConstantByName(NULL, constantDescription.Name);
if (psConstant)
{ {
unsigned int samplerIndex = mConstantTablePS->GetSamplerIndex(psConstant) + i;
if (samplerIndex < MAX_TEXTURE_IMAGE_UNITS) if (samplerIndex < MAX_TEXTURE_IMAGE_UNITS)
{ {
mSamplersPS[samplerIndex].active = true; mSamplersPS[samplerIndex].active = true;
...@@ -1872,8 +1877,10 @@ bool Program::defineUniform(const D3DXHANDLE &constantHandle, const D3DXCONSTANT ...@@ -1872,8 +1877,10 @@ bool Program::defineUniform(const D3DXHANDLE &constantHandle, const D3DXCONSTANT
} }
} }
if (mConstantTableVS->GetConstantByName(NULL, constantDescription.Name) != NULL) if (vsConstant)
{ {
unsigned int samplerIndex = mConstantTableVS->GetSamplerIndex(vsConstant) + i;
if (samplerIndex < getContext()->getMaximumVertexTextureImageUnits()) if (samplerIndex < getContext()->getMaximumVertexTextureImageUnits())
{ {
mSamplersVS[samplerIndex].active = true; mSamplersVS[samplerIndex].active = 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