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

Side by Side Diff: src/gpu/glsl/GrGLSLCaps.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/gl/builders/GrGLProgramBuilder.cpp ('k') | src/gpu/glsl/GrGLSLCaps.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 2012 Google Inc. 2 * Copyright 2012 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 8
9 #ifndef GrGLSLCaps_DEFINED 9 #ifndef GrGLSLCaps_DEFINED
10 #define GrGLSLCaps_DEFINED 10 #define GrGLSLCaps_DEFINED
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 bool flatInterpolationSupport() const { return fFlatInterpolationSupport; } 57 bool flatInterpolationSupport() const { return fFlatInterpolationSupport; }
58 58
59 bool noperspectiveInterpolationSupport() const { return fNoPerspectiveInterp olationSupport; } 59 bool noperspectiveInterpolationSupport() const { return fNoPerspectiveInterp olationSupport; }
60 60
61 bool multisampleInterpolationSupport() const { return fMultisampleInterpolat ionSupport; } 61 bool multisampleInterpolationSupport() const { return fMultisampleInterpolat ionSupport; }
62 62
63 bool sampleVariablesSupport() const { return fSampleVariablesSupport; } 63 bool sampleVariablesSupport() const { return fSampleVariablesSupport; }
64 64
65 bool sampleMaskOverrideCoverageSupport() const { return fSampleMaskOverrideC overageSupport; } 65 bool sampleMaskOverrideCoverageSupport() const { return fSampleMaskOverrideC overageSupport; }
66 66
67 bool externalTextureSupport() const { return fExternalTextureSupport; }
68
67 AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInte raction; } 69 AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInte raction; }
68 70
69 bool mustEnableAdvBlendEqs() const { 71 bool mustEnableAdvBlendEqs() const {
70 return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction; 72 return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction;
71 } 73 }
72 74
73 bool mustEnableSpecificAdvBlendEqs() const { 75 bool mustEnableSpecificAdvBlendEqs() const {
74 return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction; 76 return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction;
75 } 77 }
76 78
(...skipping 28 matching lines...) Expand all
105 107
106 // This returns the name of an extension that must be enabled in the shader, if such a thing is 108 // This returns the name of an extension that must be enabled in the shader, if such a thing is
107 // required in order to use a secondary output in the shader. This returns a nullptr if no such 109 // required in order to use a secondary output in the shader. This returns a nullptr if no such
108 // extension is required. However, the return value of this function does no t say whether dual 110 // extension is required. However, the return value of this function does no t say whether dual
109 // source blending is supported. 111 // source blending is supported.
110 const char* secondaryOutputExtensionString() const { 112 const char* secondaryOutputExtensionString() const {
111 return fSecondaryOutputExtensionString; 113 return fSecondaryOutputExtensionString;
112 } 114 }
113 115
114 const char* externalTextureExtensionString() const { 116 const char* externalTextureExtensionString() const {
117 SkASSERT(this->externalTextureSupport());
115 return fExternalTextureExtensionString; 118 return fExternalTextureExtensionString;
116 } 119 }
117 120
118 const char* noperspectiveInterpolationExtensionString() const { 121 const char* noperspectiveInterpolationExtensionString() const {
119 SkASSERT(this->noperspectiveInterpolationSupport()); 122 SkASSERT(this->noperspectiveInterpolationSupport());
120 return fNoPerspectiveInterpolationExtensionString; 123 return fNoPerspectiveInterpolationExtensionString;
121 } 124 }
122 125
123 const char* multisampleInterpolationExtensionString() const { 126 const char* multisampleInterpolationExtensionString() const {
124 SkASSERT(this->multisampleInterpolationSupport()); 127 SkASSERT(this->multisampleInterpolationSupport());
125 return fMultisampleInterpolationExtensionString; 128 return fMultisampleInterpolationExtensionString;
126 } 129 }
127 130
128 const char* sampleVariablesExtensionString() const { 131 const char* sampleVariablesExtensionString() const {
129 SkASSERT(this->sampleVariablesSupport()); 132 SkASSERT(this->sampleVariablesSupport());
130 return fSampleVariablesExtensionString; 133 return fSampleVariablesExtensionString;
131 } 134 }
132 135
136 int maxVertexSamplers() const { return fMaxVertexSamplers; }
137
138 int maxGeometrySamplers() const { return fMaxGeometrySamplers; }
139
140 int maxFragmentSamplers() const { return fMaxFragmentSamplers; }
141
142 int maxCombinedSamplers() const { return fMaxCombinedSamplers; }
143
133 /** 144 /**
134 * Given a texture's config, this determines what swizzle must be appended t o accesses to the 145 * Given a texture's config, this determines what swizzle must be appended t o accesses to the
135 * texture in generated shader code. Swizzling may be implemented in texture parameters or a 146 * texture in generated shader code. Swizzling may be implemented in texture parameters or a
136 * sampler rather than in the shader. In this case the returned swizzle will always be "rgba". 147 * sampler rather than in the shader. In this case the returned swizzle will always be "rgba".
137 */ 148 */
138 const GrSwizzle& configTextureSwizzle(GrPixelConfig config) const { 149 const GrSwizzle& configTextureSwizzle(GrPixelConfig config) const {
139 return fConfigTextureSwizzle[config]; 150 return fConfigTextureSwizzle[config];
140 } 151 }
141 152
142 /** Swizzle that should occur on the fragment shader outputs for a given con fig. */ 153 /** Swizzle that should occur on the fragment shader outputs for a given con fig. */
(...skipping 17 matching lines...) Expand all
160 bool fFBFetchSupport : 1; 171 bool fFBFetchSupport : 1;
161 bool fFBFetchNeedsCustomOutput : 1; 172 bool fFBFetchNeedsCustomOutput : 1;
162 bool fBindlessTextureSupport : 1; 173 bool fBindlessTextureSupport : 1;
163 bool fUsesPrecisionModifiers : 1; 174 bool fUsesPrecisionModifiers : 1;
164 bool fCanUseAnyFunctionInShader : 1; 175 bool fCanUseAnyFunctionInShader : 1;
165 bool fFlatInterpolationSupport : 1; 176 bool fFlatInterpolationSupport : 1;
166 bool fNoPerspectiveInterpolationSupport : 1; 177 bool fNoPerspectiveInterpolationSupport : 1;
167 bool fMultisampleInterpolationSupport : 1; 178 bool fMultisampleInterpolationSupport : 1;
168 bool fSampleVariablesSupport : 1; 179 bool fSampleVariablesSupport : 1;
169 bool fSampleMaskOverrideCoverageSupport : 1; 180 bool fSampleMaskOverrideCoverageSupport : 1;
181 bool fExternalTextureSupport : 1;
170 182
171 // Used for specific driver bug work arounds 183 // Used for specific driver bug work arounds
172 bool fCanUseMinAndAbsTogether : 1; 184 bool fCanUseMinAndAbsTogether : 1;
173 bool fMustForceNegatedAtanParamToFloat : 1; 185 bool fMustForceNegatedAtanParamToFloat : 1;
174 186
175 const char* fVersionDeclString; 187 const char* fVersionDeclString;
176 188
177 const char* fShaderDerivativeExtensionString; 189 const char* fShaderDerivativeExtensionString;
178 const char* fFragCoordConventionsExtensionString; 190 const char* fFragCoordConventionsExtensionString;
179 const char* fSecondaryOutputExtensionString; 191 const char* fSecondaryOutputExtensionString;
180 const char* fExternalTextureExtensionString; 192 const char* fExternalTextureExtensionString;
181 const char* fNoPerspectiveInterpolationExtensionString; 193 const char* fNoPerspectiveInterpolationExtensionString;
182 const char* fMultisampleInterpolationExtensionString; 194 const char* fMultisampleInterpolationExtensionString;
183 const char* fSampleVariablesExtensionString; 195 const char* fSampleVariablesExtensionString;
184 196
185 const char* fFBFetchColorName; 197 const char* fFBFetchColorName;
186 const char* fFBFetchExtensionString; 198 const char* fFBFetchExtensionString;
187 199
200 uint8_t fMaxVertexSamplers;
201 uint8_t fMaxGeometrySamplers;
202 uint8_t fMaxFragmentSamplers;
203 uint8_t fMaxCombinedSamplers;
204
188 AdvBlendEqInteraction fAdvBlendEqInteraction; 205 AdvBlendEqInteraction fAdvBlendEqInteraction;
189 206
190 GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt]; 207 GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt];
191 GrSwizzle fConfigOutputSwizzle[kGrPixelConfigCnt]; 208 GrSwizzle fConfigOutputSwizzle[kGrPixelConfigCnt];
192 209
193 friend class GrGLCaps; // For initialization. 210 friend class GrGLCaps; // For initialization.
194 friend class GrVkCaps; 211 friend class GrVkCaps;
195 212
196 typedef GrShaderCaps INHERITED; 213 typedef GrShaderCaps INHERITED;
197 }; 214 };
198 215
199 #endif 216 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | src/gpu/glsl/GrGLSLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698