OLD | NEW |
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 const char* fbFetchColorName() const { return fFBFetchColorName; } | 51 const char* fbFetchColorName() const { return fFBFetchColorName; } |
52 | 52 |
53 const char* fbFetchExtensionString() const { return fFBFetchExtensionString;
} | 53 const char* fbFetchExtensionString() const { return fFBFetchExtensionString;
} |
54 | 54 |
55 bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } | 55 bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } |
56 | 56 |
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 sampleVariablesSupport() const { return fSampleVariablesSupport; } |
| 62 |
| 63 bool sampleMaskOverrideCoverageSupport() const { return fSampleMaskOverrideC
overageSupport; } |
| 64 |
61 AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInte
raction; } | 65 AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInte
raction; } |
62 | 66 |
63 bool mustEnableAdvBlendEqs() const { | 67 bool mustEnableAdvBlendEqs() const { |
64 return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction; | 68 return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction; |
65 } | 69 } |
66 | 70 |
67 bool mustEnableSpecificAdvBlendEqs() const { | 71 bool mustEnableSpecificAdvBlendEqs() const { |
68 return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction; | 72 return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction; |
69 } | 73 } |
70 | 74 |
(...skipping 10 matching lines...) Expand all Loading... |
81 | 85 |
82 bool mustForceNegatedAtanParamToFloat() const { return fMustForceNegatedAtan
ParamToFloat; } | 86 bool mustForceNegatedAtanParamToFloat() const { return fMustForceNegatedAtan
ParamToFloat; } |
83 | 87 |
84 // Returns the string of an extension that must be enabled in the shader to
support | 88 // Returns the string of an extension that must be enabled in the shader to
support |
85 // derivatives. If nullptr is returned then no extension needs to be enabled
. Before calling | 89 // derivatives. If nullptr is returned then no extension needs to be enabled
. Before calling |
86 // this function, the caller should check that shaderDerivativeSupport exist
s. | 90 // this function, the caller should check that shaderDerivativeSupport exist
s. |
87 const char* shaderDerivativeExtensionString() const { | 91 const char* shaderDerivativeExtensionString() const { |
88 SkASSERT(this->shaderDerivativeSupport()); | 92 SkASSERT(this->shaderDerivativeSupport()); |
89 return fShaderDerivativeExtensionString; | 93 return fShaderDerivativeExtensionString; |
90 } | 94 } |
91 | 95 |
92 // Returns the string of an extension that will do all necessary coord trans
fomations needed | 96 // Returns the string of an extension that will do all necessary coord trans
fomations needed |
93 // when reading the fragment position. If such an extension does not exisits
, this function | 97 // when reading the fragment position. If such an extension does not exisits
, this function |
94 // returns a nullptr, and all transforms of the frag position must be done m
anually in the | 98 // returns a nullptr, and all transforms of the frag position must be done m
anually in the |
95 // shader. | 99 // shader. |
96 const char* fragCoordConventionsExtensionString() const { | 100 const char* fragCoordConventionsExtensionString() const { |
97 return fFragCoordConventionsExtensionString; | 101 return fFragCoordConventionsExtensionString; |
98 } | 102 } |
99 | 103 |
100 // This returns the name of an extension that must be enabled in the shader,
if such a thing is | 104 // This returns the name of an extension that must be enabled in the shader,
if such a thing is |
101 // required in order to use a secondary output in the shader. This returns a
nullptr if no such | 105 // required in order to use a secondary output in the shader. This returns a
nullptr if no such |
102 // extension is required. However, the return value of this function does no
t say whether dual | 106 // extension is required. However, the return value of this function does no
t say whether dual |
103 // source blending is supported. | 107 // source blending is supported. |
104 const char* secondaryOutputExtensionString() const { | 108 const char* secondaryOutputExtensionString() const { |
105 return fSecondaryOutputExtensionString; | 109 return fSecondaryOutputExtensionString; |
106 } | 110 } |
107 | 111 |
108 const char* externalTextureExtensionString() const { | 112 const char* externalTextureExtensionString() const { |
109 return fExternalTextureExtensionString; | 113 return fExternalTextureExtensionString; |
110 } | 114 } |
111 | 115 |
112 const char* noperspectiveInterpolationExtensionString() const { | 116 const char* noperspectiveInterpolationExtensionString() const { |
113 SkASSERT(this->noperspectiveInterpolationSupport()); | 117 SkASSERT(this->noperspectiveInterpolationSupport()); |
114 return fNoPerspectiveInterpolationExtensionString; | 118 return fNoPerspectiveInterpolationExtensionString; |
115 } | 119 } |
116 | 120 |
| 121 const char* sampleVariablesExtensionString() const { |
| 122 SkASSERT(this->sampleVariablesSupport()); |
| 123 return fSampleVariablesExtensionString; |
| 124 } |
| 125 |
117 /** | 126 /** |
118 * Given a texture's config, this determines what swizzle must be appended t
o accesses to the | 127 * Given a texture's config, this determines what swizzle must be appended t
o accesses to the |
119 * texture in generated shader code. Swizzling may be implemented in texture
parameters or a | 128 * texture in generated shader code. Swizzling may be implemented in texture
parameters or a |
120 * sampler rather than in the shader. In this case the returned swizzle will
always be "rgba". | 129 * sampler rather than in the shader. In this case the returned swizzle will
always be "rgba". |
121 */ | 130 */ |
122 const GrSwizzle& configTextureSwizzle(GrPixelConfig config) const { | 131 const GrSwizzle& configTextureSwizzle(GrPixelConfig config) const { |
123 return fConfigTextureSwizzle[config]; | 132 return fConfigTextureSwizzle[config]; |
124 } | 133 } |
125 | 134 |
126 /** Swizzle that should occur on the fragment shader outputs for a given con
fig. */ | 135 /** Swizzle that should occur on the fragment shader outputs for a given con
fig. */ |
(...skipping 14 matching lines...) Expand all Loading... |
141 GrGLSLGeneration fGLSLGeneration; | 150 GrGLSLGeneration fGLSLGeneration; |
142 | 151 |
143 bool fDropsTileOnZeroDivide : 1; | 152 bool fDropsTileOnZeroDivide : 1; |
144 bool fFBFetchSupport : 1; | 153 bool fFBFetchSupport : 1; |
145 bool fFBFetchNeedsCustomOutput : 1; | 154 bool fFBFetchNeedsCustomOutput : 1; |
146 bool fBindlessTextureSupport : 1; | 155 bool fBindlessTextureSupport : 1; |
147 bool fUsesPrecisionModifiers : 1; | 156 bool fUsesPrecisionModifiers : 1; |
148 bool fCanUseAnyFunctionInShader : 1; | 157 bool fCanUseAnyFunctionInShader : 1; |
149 bool fFlatInterpolationSupport : 1; | 158 bool fFlatInterpolationSupport : 1; |
150 bool fNoPerspectiveInterpolationSupport : 1; | 159 bool fNoPerspectiveInterpolationSupport : 1; |
| 160 bool fSampleVariablesSupport : 1; |
| 161 bool fSampleMaskOverrideCoverageSupport : 1; |
151 | 162 |
152 // Used for specific driver bug work arounds | 163 // Used for specific driver bug work arounds |
153 bool fCanUseMinAndAbsTogether : 1; | 164 bool fCanUseMinAndAbsTogether : 1; |
154 bool fMustForceNegatedAtanParamToFloat : 1; | 165 bool fMustForceNegatedAtanParamToFloat : 1; |
155 | 166 |
156 const char* fVersionDeclString; | 167 const char* fVersionDeclString; |
157 | 168 |
158 const char* fShaderDerivativeExtensionString; | 169 const char* fShaderDerivativeExtensionString; |
159 const char* fFragCoordConventionsExtensionString; | 170 const char* fFragCoordConventionsExtensionString; |
160 const char* fSecondaryOutputExtensionString; | 171 const char* fSecondaryOutputExtensionString; |
161 const char* fExternalTextureExtensionString; | 172 const char* fExternalTextureExtensionString; |
162 const char* fNoPerspectiveInterpolationExtensionString; | 173 const char* fNoPerspectiveInterpolationExtensionString; |
| 174 const char* fSampleVariablesExtensionString; |
163 | 175 |
164 const char* fFBFetchColorName; | 176 const char* fFBFetchColorName; |
165 const char* fFBFetchExtensionString; | 177 const char* fFBFetchExtensionString; |
166 | 178 |
167 AdvBlendEqInteraction fAdvBlendEqInteraction; | 179 AdvBlendEqInteraction fAdvBlendEqInteraction; |
168 | 180 |
169 GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt]; | 181 GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt]; |
170 GrSwizzle fConfigOutputSwizzle[kGrPixelConfigCnt]; | 182 GrSwizzle fConfigOutputSwizzle[kGrPixelConfigCnt]; |
171 | 183 |
172 friend class GrGLCaps; // For initialization. | 184 friend class GrGLCaps; // For initialization. |
173 friend class GrVkCaps; | 185 friend class GrVkCaps; |
174 | 186 |
175 typedef GrShaderCaps INHERITED; | 187 typedef GrShaderCaps INHERITED; |
176 }; | 188 }; |
177 | 189 |
178 #endif | 190 #endif |
OLD | NEW |