OLD | NEW |
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 #include "GrGLProgramDesc.h" | 7 #include "GrGLProgramDesc.h" |
8 | 8 |
9 #include "GrGLProcessor.h" | 9 #include "GrGLProcessor.h" |
10 #include "GrProcessor.h" | 10 #include "GrProcessor.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 desc->fKey.reset(); | 182 desc->fKey.reset(); |
183 return false; | 183 return false; |
184 } | 184 } |
185 } | 185 } |
186 | 186 |
187 for (int s = 0; s < optState.numFragmentStages(); ++s) { | 187 for (int s = 0; s < optState.numFragmentStages(); ++s) { |
188 const GrPendingFragmentStage& fps = optState.getFragmentStage(s); | 188 const GrPendingFragmentStage& fps = optState.getFragmentStage(s); |
189 const GrFragmentProcessor& fp = *fps.getProcessor(); | 189 const GrFragmentProcessor& fp = *fps.getProcessor(); |
190 GrProcessorKeyBuilder b(&desc->fKey); | 190 GrProcessorKeyBuilder b(&desc->fKey); |
191 fp.getGLProcessorKey(gpu->glCaps(), &b); | 191 fp.getGLProcessorKey(gpu->glCaps(), &b); |
192 if (!get_meta_key(fp, gpu->glCaps(), | 192 if (!get_meta_key(*fps.getProcessor(), gpu->glCaps(), |
193 gen_transform_key(fps, requiresLocalCoordAttrib), 0, &
b)) { | 193 gen_transform_key(fps, requiresLocalCoordAttrib), 0, &b
)) { |
194 desc->fKey.reset(); | 194 desc->fKey.reset(); |
195 return false; | 195 return false; |
196 } | 196 } |
197 } | 197 } |
198 | 198 |
199 const GrXferProcessor& xp = *optState.getXferProcessor(); | |
200 GrProcessorKeyBuilder b(&desc->fKey); | |
201 xp.getGLProcessorKey(gpu->glCaps(), &b); | |
202 if (!get_meta_key(xp, gpu->glCaps(), 0, 0, &b)) { | |
203 desc->fKey.reset(); | |
204 return false; | |
205 } | |
206 | |
207 // --------DO NOT MOVE HEADER ABOVE THIS LINE-------------------------------
------------------- | 199 // --------DO NOT MOVE HEADER ABOVE THIS LINE-------------------------------
------------------- |
208 // Because header is a pointer into the dynamic array, we can't push any new
data into the key | 200 // Because header is a pointer into the dynamic array, we can't push any new
data into the key |
209 // below here. | 201 // below here. |
210 GLKeyHeader* header = desc->atOffset<GLKeyHeader, kHeaderOffset>(); | 202 GLKeyHeader* header = desc->atOffset<GLKeyHeader, kHeaderOffset>(); |
211 | 203 |
212 // make sure any padding in the header is zeroed. | 204 // make sure any padding in the header is zeroed. |
213 memset(header, 0, kHeaderSize); | 205 memset(header, 0, kHeaderSize); |
214 | 206 |
215 header->fHasGeometryProcessor = optState.hasGeometryProcessor(); | 207 header->fHasGeometryProcessor = optState.hasGeometryProcessor(); |
216 | 208 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 } | 253 } |
262 | 254 |
263 if (descInfo.fReadsFragPosition) { | 255 if (descInfo.fReadsFragPosition) { |
264 header->fFragPosKey = | 256 header->fFragPosKey = |
265 GrGLFragmentShaderBuilder::KeyForFragmentPosition(optState.getRe
nderTarget(), | 257 GrGLFragmentShaderBuilder::KeyForFragmentPosition(optState.getRe
nderTarget(), |
266 gpu->glCaps())
; | 258 gpu->glCaps())
; |
267 } else { | 259 } else { |
268 header->fFragPosKey = 0; | 260 header->fFragPosKey = 0; |
269 } | 261 } |
270 | 262 |
| 263 header->fPrimaryOutputType = descInfo.fPrimaryOutputType; |
| 264 header->fSecondaryOutputType = descInfo.fSecondaryOutputType; |
| 265 |
271 header->fColorEffectCnt = optState.numColorStages(); | 266 header->fColorEffectCnt = optState.numColorStages(); |
272 header->fCoverageEffectCnt = optState.numCoverageStages(); | 267 header->fCoverageEffectCnt = optState.numCoverageStages(); |
273 desc->finalize(); | 268 desc->finalize(); |
274 return true; | 269 return true; |
275 } | 270 } |
OLD | NEW |