Avoid iterating over unused samplers.
Keep track of the maximum used sampler to avoid expensive iterations in applyTextures and validateSamplers.
BUG=
TEST=webgl conformance tests
Review URL: http://codereview.appspot.com/5246061
git-svn-id: https://angleproject.googlecode.com/svn/trunk@795 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Program.h b/src/libGLESv2/Program.h
index 87da974..a82761d 100644
--- a/src/libGLESv2/Program.h
+++ b/src/libGLESv2/Program.h
@@ -77,6 +77,7 @@
GLint getSamplerMapping(SamplerType type, unsigned int samplerIndex);
TextureType getSamplerTextureType(SamplerType type, unsigned int samplerIndex);
+ GLint getUsedSamplerRange(SamplerType type);
GLint getUniformLocation(std::string name);
bool setUniform1fv(GLint location, GLsizei count, const GLfloat *v);
@@ -197,6 +198,8 @@
Sampler mSamplersPS[MAX_TEXTURE_IMAGE_UNITS];
Sampler mSamplersVS[MAX_VERTEX_TEXTURE_IMAGE_UNITS_VTF];
+ GLuint mUsedVertexSamplerRange;
+ GLuint mUsedPixelSamplerRange;
typedef std::vector<Uniform*> UniformArray;
UniformArray mUniforms;