Index: src/gpu/gl/GrGLEffect.cpp |
=================================================================== |
--- src/gpu/gl/GrGLEffect.cpp (revision 8091) |
+++ src/gpu/gl/GrGLEffect.cpp (working copy) |
@@ -31,3 +31,18 @@ |
} |
return key; |
} |
+ |
+GrGLEffect::EffectKey GrGLEffect::GenAttribKey(const GrEffectStage& stage) { |
+ EffectKey key = 0; |
+ |
+ int numAttributes = stage.getVertexAttribIndexCount(); |
+ GrAssert(numAttributes <= 2); |
+ const int* attributeIndices = stage.getVertexAttribIndices(); |
+ for (int index = 0; index < numAttributes; ++index) { |
+ EffectKey value = attributeIndices[index] << 2*index; |
+ GrAssert(0 == (value & key)); // keys for each attribute ought not to overlap |
+ key |= value; |
+ } |
+ |
+ return key; |
+} |