OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrGLSLProgramBuilder_DEFINED | 8 #ifndef GrGLSLProgramBuilder_DEFINED |
9 #define GrGLSLProgramBuilder_DEFINED | 9 #define GrGLSLProgramBuilder_DEFINED |
10 | 10 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 GrGLSLProgramBuilder* fPB; | 132 GrGLSLProgramBuilder* fPB; |
133 }; | 133 }; |
134 | 134 |
135 // Generates a possibly mangled name for a stage variable and writes it to t
he fragment shader. | 135 // Generates a possibly mangled name for a stage variable and writes it to t
he fragment shader. |
136 // If GrGLSLExpr4 has a valid name then it will use that instead | 136 // If GrGLSLExpr4 has a valid name then it will use that instead |
137 void nameExpression(GrGLSLExpr4*, const char* baseName); | 137 void nameExpression(GrGLSLExpr4*, const char* baseName); |
138 | 138 |
139 void emitAndInstallPrimProc(const GrPrimitiveProcessor&, | 139 void emitAndInstallPrimProc(const GrPrimitiveProcessor&, |
140 GrGLSLExpr4* outputColor, | 140 GrGLSLExpr4* outputColor, |
141 GrGLSLExpr4* outputCoverage); | 141 GrGLSLExpr4* outputCoverage); |
142 void emitAndInstallFragProcs(GrGLSLExpr4* colorInOut, GrGLSLExpr4* coverageI
nOut); | 142 void emitAndInstallFragProcs(int procOffset, int numProcs, GrGLSLExpr4* inOu
t); |
143 void emitAndInstallFragProc(const GrFragmentProcessor&, | 143 void emitAndInstallFragProc(const GrFragmentProcessor&, |
144 int index, | 144 int index, |
145 int transformedCoordVarsIdx, | |
146 const GrGLSLExpr4& input, | 145 const GrGLSLExpr4& input, |
147 GrGLSLExpr4* output); | 146 GrGLSLExpr4* output); |
148 void emitAndInstallXferProc(const GrXferProcessor&, | 147 void emitAndInstallXferProc(const GrXferProcessor&, |
149 const GrGLSLExpr4& colorIn, | 148 const GrGLSLExpr4& colorIn, |
150 const GrGLSLExpr4& coverageIn, | 149 const GrGLSLExpr4& coverageIn, |
151 bool ignoresCoverage, | 150 bool ignoresCoverage, |
152 GrPixelLocalStorageState plsState); | 151 GrPixelLocalStorageState plsState); |
153 | 152 |
154 void emitSamplers(const GrProcessor& processor, | 153 void emitSamplers(const GrProcessor& processor, |
155 SkTArray<SamplerHandle>* outTexSamplers, | 154 SkTArray<SamplerHandle>* outTexSamplers, |
156 SkTArray<SamplerHandle>* outBufferSamplers); | 155 SkTArray<SamplerHandle>* outBufferSamplers); |
157 void emitSampler(GrSLType samplerType, | 156 void emitSampler(GrSLType samplerType, |
158 GrPixelConfig, | 157 GrPixelConfig, |
159 const char* name, | 158 const char* name, |
160 GrShaderFlags visibility, | 159 GrShaderFlags visibility, |
161 SkTArray<SamplerHandle>* outSamplers); | 160 SkTArray<SamplerHandle>* outSamplers); |
162 void emitFSOutputSwizzle(bool hasSecondaryOutput); | 161 void emitFSOutputSwizzle(bool hasSecondaryOutput); |
163 bool checkSamplerCounts(); | 162 bool checkSamplerCounts(); |
164 | 163 |
165 #ifdef SK_DEBUG | 164 #ifdef SK_DEBUG |
166 void verify(const GrPrimitiveProcessor&); | 165 void verify(const GrPrimitiveProcessor&); |
167 void verify(const GrXferProcessor&); | 166 void verify(const GrXferProcessor&); |
168 void verify(const GrFragmentProcessor&); | 167 void verify(const GrFragmentProcessor&); |
169 #endif | 168 #endif |
170 | 169 |
171 int fNumVertexSamplers; | 170 GrGLSLPrimitiveProcessor::TransformsIn fCoordTransforms; |
172 int fNumGeometrySamplers; | 171 GrGLSLPrimitiveProcessor::TransformsOut fOutCoords; |
173 int fNumFragmentSamplers; | 172 int fNumVertexSamplers; |
174 SkSTArray<4, GrShaderVar> fTransformedCoordVars; | 173 int fNumGeometrySamplers; |
| 174 int fNumFragmentSamplers; |
175 }; | 175 }; |
176 | 176 |
177 #endif | 177 #endif |
OLD | NEW |