Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/gpu/gl/GrGLProgramDesc.h

Issue 13296005: Revise attribute binding interface (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrGLProgramDesc_DEFINED 8 #ifndef GrGLProgramDesc_DEFINED
9 #define GrGLProgramDesc_DEFINED 9 #define GrGLProgramDesc_DEFINED
10 10
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 30
31 // Returns this as a uint32_t array to be used as a key in the program cache 31 // Returns this as a uint32_t array to be used as a key in the program cache
32 const uint32_t* asKey() const { 32 const uint32_t* asKey() const {
33 return reinterpret_cast<const uint32_t*>(this); 33 return reinterpret_cast<const uint32_t*>(this);
34 } 34 }
35 35
36 // For unit testing. 36 // For unit testing.
37 void setRandom(SkMWCRandom*, 37 void setRandom(SkMWCRandom*,
38 const GrGpuGL* gpu, 38 const GrGpuGL* gpu,
39 const GrEffectStage stages[GrDrawState::kNumStages]); 39 const GrEffectStage stages[GrDrawState::kNumStages],
40 int currAttribIndex);
40 41
41 /** 42 /**
42 * Builds a program descriptor from a GrDrawState. Whether the primitive typ e is points, the 43 * Builds a program descriptor from a GrDrawState. Whether the primitive typ e is points, the
43 * output of GrDrawState::getBlendOpts, and the caps of the GrGpuGL are also inputs. 44 * output of GrDrawState::getBlendOpts, and the caps of the GrGpuGL are also inputs.
44 */ 45 */
45 static void Build(const GrDrawState&, 46 static void Build(const GrDrawState&,
46 bool isPoints, 47 bool isPoints,
47 GrDrawState::BlendOptFlags, 48 GrDrawState::BlendOptFlags,
48 GrBlendCoeff srcCoeff, 49 GrBlendCoeff srcCoeff,
49 GrBlendCoeff dstCoeff, 50 GrBlendCoeff dstCoeff,
(...skipping 15 matching lines...) Expand all
65 // secondary source is output and what value it holds. 66 // secondary source is output and what value it holds.
66 enum DualSrcOutput { 67 enum DualSrcOutput {
67 kNone_DualSrcOutput, 68 kNone_DualSrcOutput,
68 kCoverage_DualSrcOutput, 69 kCoverage_DualSrcOutput,
69 kCoverageISA_DualSrcOutput, 70 kCoverageISA_DualSrcOutput,
70 kCoverageISC_DualSrcOutput, 71 kCoverageISC_DualSrcOutput,
71 72
72 kDualSrcOutputCnt 73 kDualSrcOutputCnt
73 }; 74 };
74 75
75 // should the FS discard if the coverage is zero (to avoid stencil manipulat ion)
76 bool fDiscardIfZeroCoverage;
77
78 // stripped of bits that don't affect program generation
79 GrAttribBindings fAttribBindings;
80
81 /** Non-zero if this stage has an effect */ 76 /** Non-zero if this stage has an effect */
82 GrGLEffect::EffectKey fEffectKeys[GrDrawState::kNumStages]; 77 GrGLEffect::EffectKey fEffectKeys[GrDrawState::kNumStages];
83 78
79 // should the FS discard if the coverage is zero (to avoid stencil manipulat ion)
80 SkBool8 fDiscardIfZeroCoverage;
81
82 uint8_t fColorInput; // casts to enum ColorIn put
83 uint8_t fCoverageInput; // casts to enum ColorIn put
84 uint8_t fDualSrcOutput; // casts to enum DualSrc Output
85
86 int8_t fFirstCoverageStage;
87 SkBool8 fEmitsPointSize;
88 uint8_t fColorFilterXfermode; // casts to enum SkXferm ode::Mode
89
90 int8_t fPositionAttributeIndex;
91 int8_t fLocalCoordAttributeIndex;
92 int8_t fColorAttributeIndex;
93 int8_t fCoverageAttributeIndex;
94
84 // To enable experimental geometry shader code (not for use in 95 // To enable experimental geometry shader code (not for use in
85 // production) 96 // production)
86 #if GR_GL_EXPERIMENTAL_GS 97 #if GR_GL_EXPERIMENTAL_GS
87 bool fExperimentalGS; 98 bool fExperimentalGS;
88 #endif 99 #endif
89 uint8_t fColorInput; // casts to enum ColorIn put
90 uint8_t fCoverageInput; // casts to enum ColorIn put
91 uint8_t fDualSrcOutput; // casts to enum DualSrc Output
92 int8_t fFirstCoverageStage;
93 SkBool8 fEmitsPointSize;
94 uint8_t fColorFilterXfermode; // casts to enum SkXferm ode::Mode
95
96 int8_t fPositionAttributeIndex;
97 int8_t fColorAttributeIndex;
98 int8_t fCoverageAttributeIndex;
99 int8_t fLocalCoordsAttributeIndex;
100 100
101 // GrGLProgram reads the private fields to generate code. 101 // GrGLProgram reads the private fields to generate code.
102 friend class GrGLProgram; 102 friend class GrGLProgram;
103 }; 103 };
104 104
105 #endif 105 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698