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/GrGLSLVarying.h" |
14 #include "glsl/GrGLSLXferProcessor.h" | 14 #include "glsl/GrGLSLXferProcessor.h" |
15 | 15 |
16 const int GrGLSLProgramBuilder::kVarsPerBlock = 8; | 16 const int GrGLSLProgramBuilder::kVarsPerBlock = 8; |
17 | 17 |
18 GrGLSLProgramBuilder::GrGLSLProgramBuilder(const DrawArgs& args) | 18 GrGLSLProgramBuilder::GrGLSLProgramBuilder(const GrPipeline& pipeline, |
| 19 const GrPrimitiveProcessor& primProc, |
| 20 const GrProgramDesc& desc) |
19 : fVS(this) | 21 : fVS(this) |
20 , fGS(this) | 22 , fGS(this) |
21 , fFS(this) | 23 , fFS(this) |
22 , fStageIndex(-1) | 24 , fStageIndex(-1) |
23 , fArgs(args) | 25 , fPipeline(pipeline) |
| 26 , fPrimProc(primProc) |
| 27 , fDesc(desc) |
24 , fGeometryProcessor(nullptr) | 28 , fGeometryProcessor(nullptr) |
25 , fXferProcessor(nullptr) | 29 , fXferProcessor(nullptr) |
26 , fSamplerUniforms(4) | 30 , fSamplerUniforms(4) |
27 , fNumVertexSamplers(0) | 31 , fNumVertexSamplers(0) |
28 , fNumGeometrySamplers(0) | 32 , fNumGeometrySamplers(0) |
29 , fNumFragmentSamplers(0) { | 33 , fNumFragmentSamplers(0) { |
30 } | 34 } |
31 | 35 |
32 void GrGLSLProgramBuilder::addFeature(GrShaderFlags shaders, | 36 void GrGLSLProgramBuilder::addFeature(GrShaderFlags shaders, |
33 uint32_t featureBit, | 37 uint32_t featureBit, |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 delete fFragmentProcessors[i]; | 363 delete fFragmentProcessors[i]; |
360 } | 364 } |
361 } | 365 } |
362 | 366 |
363 void GrGLSLProgramBuilder::finalizeShaders() { | 367 void GrGLSLProgramBuilder::finalizeShaders() { |
364 this->varyingHandler()->finalize(); | 368 this->varyingHandler()->finalize(); |
365 fVS.finalize(kVertex_GrShaderFlag); | 369 fVS.finalize(kVertex_GrShaderFlag); |
366 fFS.finalize(kFragment_GrShaderFlag); | 370 fFS.finalize(kFragment_GrShaderFlag); |
367 | 371 |
368 } | 372 } |
OLD | NEW |