Take two for r8466:
Replace the old attribute binding and index interface with one where we include the binding as part of the attribute array. Also removed the fixed attribute indices for constant color and coverage attributes, and replaced with dynamic ones based on current attribute set. Removed binding of color and coverage attributes unless they're actually set.
Original author: bsalomon@google.com
Author: jvanverth@google.com
Reviewed By: bsalomon@google.com,robertphillips@google.com
Review URL: https://chromiumcodereview.appspot.com/13296005
git-svn-id: http://skia.googlecode.com/svn/trunk@8468 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index 27b6f80..4b5dfea 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -60,18 +60,23 @@
GrGLuint programID() const { return fProgramID; }
/**
- * Some GL state that is relevant to programs is not stored per-program. In particular vertex
- * attributes are global state. This struct is read and updated by GrGLProgram::setData to
- * allow us to avoid setting this state redundantly.
+ * Some GL state that is relevant to programs is not stored per-program. In particular color
+ * and coverage attributes can be global state. This struct is read and updated by
+ * GrGLProgram::setColor and GrGLProgram::setCoverage to allow us to avoid setting this state
+ * redundantly.
*/
struct SharedGLState {
GrColor fConstAttribColor;
+ int fConstAttribColorIndex;
GrColor fConstAttribCoverage;
+ int fConstAttribCoverageIndex;
SharedGLState() { this->invalidate(); }
void invalidate() {
fConstAttribColor = GrColor_ILLEGAL;
+ fConstAttribColorIndex = -1;
fConstAttribCoverage = GrColor_ILLEGAL;
+ fConstAttribCoverageIndex = -1;
}
};