Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: src/gpu/glsl/GrGLSLProgramBuilder.h

Issue 1782583002: Add support for vertex and geometry shader textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: better rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/glsl/GrGLSLCaps.cpp ('k') | src/gpu/glsl/GrGLSLProgramBuilder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLCaps.cpp ('k') | src/gpu/glsl/GrGLSLProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698