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

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

Issue 1785873003: Implement GL support for buffer textures (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_glTexBuffer
Patch Set: 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/GrGLSLProgramBuilder.cpp ('k') | src/gpu/glsl/GrGLSLShaderBuilder.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 2014 Google Inc. 2 * Copyright 2014 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 GrGLSLShaderBuilder_DEFINED 8 #ifndef GrGLSLShaderBuilder_DEFINED
9 #define GrGLSLShaderBuilder_DEFINED 9 #define GrGLSLShaderBuilder_DEFINED
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 /** Does the work of appendTextureLookup and modulates the result by modulat ion. The result is 43 /** Does the work of appendTextureLookup and modulates the result by modulat ion. The result is
44 always a vec4. modulation and the swizzle specified by GrGLSLTextureSamp ler must both be 44 always a vec4. modulation and the swizzle specified by GrGLSLTextureSamp ler must both be
45 vec4 or float. If modulation is "" or nullptr it this function acts as t hough 45 vec4 or float. If modulation is "" or nullptr it this function acts as t hough
46 appendTextureLookup were called. */ 46 appendTextureLookup were called. */
47 void appendTextureLookupAndModulate(const char* modulation, 47 void appendTextureLookupAndModulate(const char* modulation,
48 const GrGLSLTextureSampler&, 48 const GrGLSLTextureSampler&,
49 const char* coordName, 49 const char* coordName,
50 GrSLType coordType = kVec2f_GrSLType); 50 GrSLType coordType = kVec2f_GrSLType);
51 51
52 void appendTextureLookup(const GrGLSLTextureSampler& sampler, const GrGLSLSh aderVar& coord) {
53 this->appendTextureLookup(sampler, coord.getName().c_str(), coord.getTyp e());
54 }
55
56 void appendTextureLookupAndModulate(const char* modulation,
57 const GrGLSLTextureSampler& sampler,
58 const GrGLSLShaderVar& coord) {
59 this->appendTextureLookupAndModulate(modulation, sampler, coord.getName( ).c_str(),
60 coord.getType());
61 }
62
52 /** 63 /**
53 * Adds a #define directive to the top of the shader. 64 * Adds a #define directive to the top of the shader.
54 */ 65 */
55 void define(const char* macro, const char* replacement) { 66 void define(const char* macro, const char* replacement) {
56 this->definitions().appendf("#define %s %s\n", macro, replacement); 67 this->definitions().appendf("#define %s %s\n", macro, replacement);
57 } 68 }
58 69
59 void define(const char* macro, int replacement) { 70 void define(const char* macro, int replacement) {
60 this->definitions().appendf("#define %s %i\n", macro, replacement); 71 this->definitions().appendf("#define %s %i\n", macro, replacement);
61 } 72 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 void appendDecls(const VarArray& vars, SkString* out) const; 144 void appendDecls(const VarArray& vars, SkString* out) const;
134 145
135 /** 146 /**
136 * Features that should only be enabled internally by the builders. 147 * Features that should only be enabled internally by the builders.
137 */ 148 */
138 enum GLSLPrivateFeature { 149 enum GLSLPrivateFeature {
139 kFragCoordConventions_GLSLPrivateFeature, 150 kFragCoordConventions_GLSLPrivateFeature,
140 kBlendEquationAdvanced_GLSLPrivateFeature, 151 kBlendEquationAdvanced_GLSLPrivateFeature,
141 kBlendFuncExtended_GLSLPrivateFeature, 152 kBlendFuncExtended_GLSLPrivateFeature,
142 kExternalTexture_GLSLPrivateFeature, 153 kExternalTexture_GLSLPrivateFeature,
154 kBufferTexture_GLSLPrivateFeature,
143 kFramebufferFetch_GLSLPrivateFeature, 155 kFramebufferFetch_GLSLPrivateFeature,
144 kNoPerspectiveInterpolation_GLSLPrivateFeature, 156 kNoPerspectiveInterpolation_GLSLPrivateFeature,
145 kSampleVariables_GLSLPrivateFeature, 157 kSampleVariables_GLSLPrivateFeature,
146 kSampleMaskOverrideCoverage_GLSLPrivateFeature, 158 kSampleMaskOverrideCoverage_GLSLPrivateFeature,
147 kLastGLSLPrivateFeature = kSampleMaskOverrideCoverage_GLSLPrivateFeature 159 kLastGLSLPrivateFeature = kSampleMaskOverrideCoverage_GLSLPrivateFeature
148 }; 160 };
149 161
150 /* 162 /*
151 * A general function which enables an extension in a shader if the feature bit is not present 163 * A general function which enables an extension in a shader if the feature bit is not present
152 * 164 *
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 int fCodeIndex; 232 int fCodeIndex;
221 bool fFinalized; 233 bool fFinalized;
222 234
223 friend class GrGLSLProgramBuilder; 235 friend class GrGLSLProgramBuilder;
224 friend class GrGLProgramBuilder; 236 friend class GrGLProgramBuilder;
225 friend class GrGLSLVaryingHandler; // to access noperspective interpolation feature. 237 friend class GrGLSLVaryingHandler; // to access noperspective interpolation feature.
226 friend class GrGLPathProgramBuilder; // to access fInputs. 238 friend class GrGLPathProgramBuilder; // to access fInputs.
227 friend class GrVkProgramBuilder; 239 friend class GrVkProgramBuilder;
228 }; 240 };
229 #endif 241 #endif
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.cpp ('k') | src/gpu/glsl/GrGLSLShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698