Increase bits for effect attribute key.

We can have an attribute index value up to 7, but only allow 2 bits for each
index in GrGLEffect::GenAttribKey. This change gives them 3 bits (and fixes an
assert when running tests in debug).

Review URL: https://codereview.chromium.org/12431018/


git-svn-id: http://skia.googlecode.com/svn/trunk@8140 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
jvanverth@google.com 2013-03-13 21:05:14 +00:00
parent 1ab0aac672
commit c3413d6f41
2 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ public:
* automatically with the bits produced by GrGLEffect::GenKey().
*/
kTextureKeyBits = 6,
kAttribKeyBits = 4
kAttribKeyBits = 6
};
virtual EffectKey glEffectKey(const GrEffectStage&, const GrGLCaps&) const = 0;

View File

@ -39,7 +39,7 @@ GrGLEffect::EffectKey GrGLEffect::GenAttribKey(const GrEffectStage& stage) {
GrAssert(numAttributes <= 2);
const int* attributeIndices = stage.getVertexAttribIndices();
for (int index = 0; index < numAttributes; ++index) {
EffectKey value = attributeIndices[index] << 2*index;
EffectKey value = attributeIndices[index] << 3*index;
GrAssert(0 == (value & key)); // keys for each attribute ought not to overlap
key |= value;
}