aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu/src/GrGLProgram.h
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-04-19 21:15:09 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-04-19 21:15:09 +0000
commit4be283f3a82895530d1b70372cd48ddb1c663fd8 (patch)
tree6b439eed9d51302125f5448683b6984b7f113f0a /gpu/src/GrGLProgram.h
parentc733996e84cbac28492e133e00c573740a8708c4 (diff)
Adds a build flag for GL to never use vertex attributes that don't have per-vertex values.
Also promotes the ATTRIBUTE_MATRIX flag that was local to cpp files to the public config file. Review URL: http://codereview.appspot.com/4434057/ git-svn-id: http://skia.googlecode.com/svn/trunk@1155 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrGLProgram.h')
-rw-r--r--gpu/src/GrGLProgram.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/gpu/src/GrGLProgram.h b/gpu/src/GrGLProgram.h
index 1a15953e74..bc740384df 100644
--- a/gpu/src/GrGLProgram.h
+++ b/gpu/src/GrGLProgram.h
@@ -84,16 +84,22 @@ private:
//Parameters that affect code generation
struct ProgramDesc {
+ ProgramDesc() {
+ // since we use this as part of a key we can't have any unitialized
+ // padding
+ memset(this, 0, sizeof(ProgramDesc));
+ }
+
+ // stripped of bits that don't affect prog generation
GrVertexLayout fVertexLayout;
enum {
- kNotPoints_OptFlagBit = 0x1,
- kVertexColorAllOnes_OptFlagBit = 0x2,
- };
- // we're assuming optflags and layout pack into 32 bits
- // VS 2010 seems to require short rather than just unsigned
- // for this to pack
- unsigned short fOptFlags : 16;
+ kNone_ColorType = 0,
+ kAttribute_ColorType = 1,
+ kUniform_ColorType = 2,
+ } fColorType;
+
+ bool fEmitsPointSize;
struct StageDesc {
enum OptFlagBits {
@@ -118,6 +124,8 @@ private:
} fStages[GrDrawTarget::kNumStages];
} fProgramDesc;
+ const ProgramDesc& getDesc() { return fProgramDesc; }
+
public:
struct StageUniLocations {
GrGLint fTextureMatrixUni;
@@ -127,6 +135,7 @@ public:
struct UniLocations {
GrGLint fViewMatrixUni;
+ GrGLint fColorUni;
StageUniLocations fStages[GrDrawTarget::kNumStages];
};
@@ -177,6 +186,7 @@ public:
// these reflect the current values of uniforms
// (GL uniform values travel with program)
+ GrColor fColor;
GrMatrix fTextureMatrices[GrDrawTarget::kNumStages];
GrScalar fRadial2CenterX1[GrDrawTarget::kNumStages];
GrScalar fRadial2Radius0[GrDrawTarget::kNumStages];