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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 BuiltinUniformHandles fUniformHandles; | 87 BuiltinUniformHandles fUniformHandles; |
88 | 88 |
89 GrGLSLPrimitiveProcessor* fGeometryProcessor; | 89 GrGLSLPrimitiveProcessor* fGeometryProcessor; |
90 GrGLSLXferProcessor* fXferProcessor; | 90 GrGLSLXferProcessor* fXferProcessor; |
91 GrGLSLFragProcs fFragmentProcessors; | 91 GrGLSLFragProcs fFragmentProcessors; |
92 | 92 |
93 protected: | 93 protected: |
94 explicit GrGLSLProgramBuilder(const DrawArgs& args); | 94 explicit GrGLSLProgramBuilder(const DrawArgs& args); |
95 | 95 |
96 bool emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr4* inputCoverage
, int maxTextures); | 96 void addFeature(GrShaderFlags shaders, uint32_t featureBit, const char* exte
nsionName); |
| 97 |
| 98 bool emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr4* inputCoverage
); |
97 | 99 |
98 void cleanupFragmentProcessors(); | 100 void cleanupFragmentProcessors(); |
99 | 101 |
100 void finalizeShaders(); | 102 void finalizeShaders(); |
101 | 103 |
| 104 SkTArray<UniformHandle> fSamplerUniforms; |
| 105 |
102 private: | 106 private: |
103 // reset is called by program creator between each processor's emit code. I
t increments the | 107 // reset is called by program creator between each processor's emit code. I
t increments the |
104 // stage offset for variable name mangling, and also ensures verfication var
iables in the | 108 // stage offset for variable name mangling, and also ensures verfication var
iables in the |
105 // fragment shader are cleared. | 109 // fragment shader are cleared. |
106 void reset() { | 110 void reset() { |
107 this->addStage(); | 111 this->addStage(); |
108 SkDEBUGCODE(fFS.resetVerification();) | 112 SkDEBUGCODE(fFS.resetVerification();) |
109 } | 113 } |
110 void addStage() { fStageIndex++; } | 114 void addStage() { fStageIndex++; } |
111 | 115 |
(...skipping 20 matching lines...) Expand all Loading... |
132 void emitAndInstallFragProcs(int procOffset, int numProcs, GrGLSLExpr4* inOu
t); | 136 void emitAndInstallFragProcs(int procOffset, int numProcs, GrGLSLExpr4* inOu
t); |
133 void emitAndInstallFragProc(const GrFragmentProcessor&, | 137 void emitAndInstallFragProc(const GrFragmentProcessor&, |
134 int index, | 138 int index, |
135 const GrGLSLExpr4& input, | 139 const GrGLSLExpr4& input, |
136 GrGLSLExpr4* output); | 140 GrGLSLExpr4* output); |
137 void emitAndInstallXferProc(const GrXferProcessor&, | 141 void emitAndInstallXferProc(const GrXferProcessor&, |
138 const GrGLSLExpr4& colorIn, | 142 const GrGLSLExpr4& colorIn, |
139 const GrGLSLExpr4& coverageIn, | 143 const GrGLSLExpr4& coverageIn, |
140 bool ignoresCoverage, | 144 bool ignoresCoverage, |
141 GrPixelLocalStorageState plsState); | 145 GrPixelLocalStorageState plsState); |
| 146 void emitSamplers(const GrProcessor& processor, |
| 147 GrGLSLTextureSampler::TextureSamplerArray* outSamplers); |
142 void emitFSOutputSwizzle(bool hasSecondaryOutput); | 148 void emitFSOutputSwizzle(bool hasSecondaryOutput); |
| 149 bool checkSamplerCounts(); |
143 | 150 |
144 #ifdef SK_DEBUG | 151 #ifdef SK_DEBUG |
145 void verify(const GrPrimitiveProcessor&); | 152 void verify(const GrPrimitiveProcessor&); |
146 void verify(const GrXferProcessor&); | 153 void verify(const GrXferProcessor&); |
147 void verify(const GrFragmentProcessor&); | 154 void verify(const GrFragmentProcessor&); |
148 #endif | 155 #endif |
149 | 156 |
150 virtual void emitSamplers(const GrProcessor& processor, | 157 GrGLSLPrimitiveProcessor::TransformsIn fCoordTransforms; |
151 GrGLSLTextureSampler::TextureSamplerArray* outSamp
lers) = 0; | 158 GrGLSLPrimitiveProcessor::TransformsOut fOutCoords; |
152 | 159 int fNumVertexSamplers; |
153 GrGLSLPrimitiveProcessor::TransformsIn fCoordTransforms; | 160 int fNumGeometrySamplers; |
154 GrGLSLPrimitiveProcessor::TransformsOut fOutCoords; | 161 int fNumFragmentSamplers; |
155 }; | 162 }; |
156 | 163 |
157 #endif | 164 #endif |
OLD | NEW |