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(int procOffset, int numProcs, GrGLSLExpr4* inOu
t); | 142 void emitAndInstallFragProcs(GrGLSLExpr4* colorInOut, GrGLSLExpr4* coverageI
nOut); |
143 void emitAndInstallFragProc(const GrFragmentProcessor&, | 143 void emitAndInstallFragProc(const GrFragmentProcessor&, |
144 int index, | 144 int index, |
| 145 int transformedCoordVarsIdx, |
145 const GrGLSLExpr4& input, | 146 const GrGLSLExpr4& input, |
146 GrGLSLExpr4* output); | 147 GrGLSLExpr4* output); |
147 void emitAndInstallXferProc(const GrXferProcessor&, | 148 void emitAndInstallXferProc(const GrXferProcessor&, |
148 const GrGLSLExpr4& colorIn, | 149 const GrGLSLExpr4& colorIn, |
149 const GrGLSLExpr4& coverageIn, | 150 const GrGLSLExpr4& coverageIn, |
150 bool ignoresCoverage, | 151 bool ignoresCoverage, |
151 GrPixelLocalStorageState plsState); | 152 GrPixelLocalStorageState plsState); |
152 | 153 |
153 void emitSamplers(const GrProcessor& processor, | 154 void emitSamplers(const GrProcessor& processor, |
154 SkTArray<SamplerHandle>* outTexSamplers, | 155 SkTArray<SamplerHandle>* outTexSamplers, |
155 SkTArray<SamplerHandle>* outBufferSamplers); | 156 SkTArray<SamplerHandle>* outBufferSamplers); |
156 void emitSampler(GrSLType samplerType, | 157 void emitSampler(GrSLType samplerType, |
157 GrPixelConfig, | 158 GrPixelConfig, |
158 const char* name, | 159 const char* name, |
159 GrShaderFlags visibility, | 160 GrShaderFlags visibility, |
160 SkTArray<SamplerHandle>* outSamplers); | 161 SkTArray<SamplerHandle>* outSamplers); |
161 void emitFSOutputSwizzle(bool hasSecondaryOutput); | 162 void emitFSOutputSwizzle(bool hasSecondaryOutput); |
162 bool checkSamplerCounts(); | 163 bool checkSamplerCounts(); |
163 | 164 |
164 #ifdef SK_DEBUG | 165 #ifdef SK_DEBUG |
165 void verify(const GrPrimitiveProcessor&); | 166 void verify(const GrPrimitiveProcessor&); |
166 void verify(const GrXferProcessor&); | 167 void verify(const GrXferProcessor&); |
167 void verify(const GrFragmentProcessor&); | 168 void verify(const GrFragmentProcessor&); |
168 #endif | 169 #endif |
169 | 170 |
170 GrGLSLPrimitiveProcessor::TransformsIn fCoordTransforms; | 171 int fNumVertexSamplers; |
171 GrGLSLPrimitiveProcessor::TransformsOut fOutCoords; | 172 int fNumGeometrySamplers; |
172 int fNumVertexSamplers; | 173 int fNumFragmentSamplers; |
173 int fNumGeometrySamplers; | 174 SkSTArray<4, GrShaderVar> fTransformedCoordVars; |
174 int fNumFragmentSamplers; | |
175 }; | 175 }; |
176 | 176 |
177 #endif | 177 #endif |
OLD | NEW |