Select texture type based on program usage.
TRAC #11410
Add Program::getSamplerType() and internal machinery to track the reported sampler uniforms.
Make State::samplerTexture into a 2D array with a dimension for sampler type.
Context::applyTextures queries the sampler type and asks for the right texture.
Author: Andrew Lewycky
Signed-off-by: Shannon Woods
Signed-off-by: Daniel Koch
git-svn-id: https://angleproject.googlecode.com/svn/trunk@25 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/libGLESv2/Program.h b/libGLESv2/Program.h
index 3e72d86..157e36e 100644
--- a/libGLESv2/Program.h
+++ b/libGLESv2/Program.h
@@ -65,6 +65,7 @@
int getInputMapping(int attributeIndex);
GLint getSamplerMapping(unsigned int samplerIndex);
+ SamplerType getSamplerType(unsigned int samplerIndex);
GLint getUniformLocation(const char *name);
bool setUniform1fv(GLint location, GLsizei count, const GLfloat *v);
@@ -115,7 +116,14 @@
char *mAttributeName[MAX_VERTEX_ATTRIBS];
int mInputMapping[MAX_VERTEX_ATTRIBS];
- GLint mSamplerMapping[MAX_TEXTURE_IMAGE_UNITS];
+ struct Sampler
+ {
+ bool active;
+ GLint logicalTextureUnit;
+ SamplerType type;
+ };
+
+ Sampler mSamplers[MAX_TEXTURE_IMAGE_UNITS];
typedef std::vector<Uniform*> UniformArray;
UniformArray mUniforms;