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 #include "glsl/GrGLSLProgramBuilder.h" | 8 #include "glsl/GrGLSLProgramBuilder.h" |
9 | 9 |
10 #include "GrPipeline.h" | 10 #include "GrPipeline.h" |
11 #include "glsl/GrGLSLFragmentProcessor.h" | 11 #include "glsl/GrGLSLFragmentProcessor.h" |
12 #include "glsl/GrGLSLGeometryProcessor.h" | 12 #include "glsl/GrGLSLGeometryProcessor.h" |
| 13 #include "glsl/GrGLSLVarying.h" |
13 #include "glsl/GrGLSLXferProcessor.h" | 14 #include "glsl/GrGLSLXferProcessor.h" |
14 | 15 |
15 const int GrGLSLProgramBuilder::kVarsPerBlock = 8; | 16 const int GrGLSLProgramBuilder::kVarsPerBlock = 8; |
16 | 17 |
17 GrGLSLProgramBuilder::GrGLSLProgramBuilder(const DrawArgs& args) | 18 GrGLSLProgramBuilder::GrGLSLProgramBuilder(const DrawArgs& args) |
18 : fVS(this) | 19 : fVS(this) |
19 , fGS(this) | 20 , fGS(this) |
20 , fFS(this, args.fDesc->header().fFragPosKey) | 21 , fFS(this, args.fDesc->header().fFragPosKey) |
21 , fStageIndex(-1) | 22 , fStageIndex(-1) |
22 , fArgs(args) | 23 , fArgs(args) |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 kFloat_GrSLType, kDefault_Gr
SLPrecision, | 280 kFloat_GrSLType, kDefault_Gr
SLPrecision, |
280 name, false, 0, outName); | 281 name, false, 0, outName); |
281 } | 282 } |
282 | 283 |
283 void GrGLSLProgramBuilder::cleanupFragmentProcessors() { | 284 void GrGLSLProgramBuilder::cleanupFragmentProcessors() { |
284 for (int i = 0; i < fFragmentProcessors.count(); ++i) { | 285 for (int i = 0; i < fFragmentProcessors.count(); ++i) { |
285 delete fFragmentProcessors[i]; | 286 delete fFragmentProcessors[i]; |
286 } | 287 } |
287 } | 288 } |
288 | 289 |
| 290 void GrGLSLProgramBuilder::finalizeShaders() { |
| 291 this->varyingHandler()->finalize(); |
| 292 fVS.finalize(GrGLSLUniformHandler::kVertex_Visibility); |
| 293 fFS.finalize(GrGLSLUniformHandler::kFragment_Visibility); |
| 294 |
| 295 } |
OLD | NEW |