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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 bool bindlessTextureSupport() const { return fBindlessTextureSupport; } | 47 bool bindlessTextureSupport() const { return fBindlessTextureSupport; } |
48 | 48 |
49 const char* versionDeclString() const { return fVersionDeclString; } | 49 const char* versionDeclString() const { return fVersionDeclString; } |
50 | 50 |
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; } |
| 58 |
| 59 bool noperspectiveInterpolationSupport() const { return fNoPerspectiveInterp
olationSupport; } |
| 60 |
57 AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInte
raction; } | 61 AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInte
raction; } |
58 | 62 |
59 bool mustEnableAdvBlendEqs() const { | 63 bool mustEnableAdvBlendEqs() const { |
60 return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction; | 64 return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction; |
61 } | 65 } |
62 | 66 |
63 bool mustEnableSpecificAdvBlendEqs() const { | 67 bool mustEnableSpecificAdvBlendEqs() const { |
64 return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction; | 68 return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction; |
65 } | 69 } |
66 | 70 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // extension is required. However, the return value of this function does no
t say whether dual | 102 // extension is required. However, the return value of this function does no
t say whether dual |
99 // source blending is supported. | 103 // source blending is supported. |
100 const char* secondaryOutputExtensionString() const { | 104 const char* secondaryOutputExtensionString() const { |
101 return fSecondaryOutputExtensionString; | 105 return fSecondaryOutputExtensionString; |
102 } | 106 } |
103 | 107 |
104 const char* externalTextureExtensionString() const { | 108 const char* externalTextureExtensionString() const { |
105 return fExternalTextureExtensionString; | 109 return fExternalTextureExtensionString; |
106 } | 110 } |
107 | 111 |
| 112 const char* noperspectiveInterpolationExtensionString() const { |
| 113 SkASSERT(this->noperspectiveInterpolationSupport()); |
| 114 return fNoPerspectiveInterpolationExtensionString; |
| 115 } |
| 116 |
108 /** | 117 /** |
109 * Given a texture's config, this determines what swizzle must be appended t
o accesses to the | 118 * Given a texture's config, this determines what swizzle must be appended t
o accesses to the |
110 * texture in generated shader code. Swizzling may be implemented in texture
parameters or a | 119 * texture in generated shader code. Swizzling may be implemented in texture
parameters or a |
111 * sampler rather than in the shader. In this case the returned swizzle will
always be "rgba". | 120 * sampler rather than in the shader. In this case the returned swizzle will
always be "rgba". |
112 */ | 121 */ |
113 const GrSwizzle& configTextureSwizzle(GrPixelConfig config) const { | 122 const GrSwizzle& configTextureSwizzle(GrPixelConfig config) const { |
114 return fConfigTextureSwizzle[config]; | 123 return fConfigTextureSwizzle[config]; |
115 } | 124 } |
116 | 125 |
117 /** Swizzle that should occur on the fragment shader outputs for a given con
fig. */ | 126 /** Swizzle that should occur on the fragment shader outputs for a given con
fig. */ |
(...skipping 12 matching lines...) Expand all Loading... |
130 void onApplyOptionsOverrides(const GrContextOptions& options) override; | 139 void onApplyOptionsOverrides(const GrContextOptions& options) override; |
131 | 140 |
132 GrGLSLGeneration fGLSLGeneration; | 141 GrGLSLGeneration fGLSLGeneration; |
133 | 142 |
134 bool fDropsTileOnZeroDivide : 1; | 143 bool fDropsTileOnZeroDivide : 1; |
135 bool fFBFetchSupport : 1; | 144 bool fFBFetchSupport : 1; |
136 bool fFBFetchNeedsCustomOutput : 1; | 145 bool fFBFetchNeedsCustomOutput : 1; |
137 bool fBindlessTextureSupport : 1; | 146 bool fBindlessTextureSupport : 1; |
138 bool fUsesPrecisionModifiers : 1; | 147 bool fUsesPrecisionModifiers : 1; |
139 bool fCanUseAnyFunctionInShader : 1; | 148 bool fCanUseAnyFunctionInShader : 1; |
| 149 bool fFlatInterpolationSupport : 1; |
| 150 bool fNoPerspectiveInterpolationSupport : 1; |
140 | 151 |
141 // Used for specific driver bug work arounds | 152 // Used for specific driver bug work arounds |
142 bool fCanUseMinAndAbsTogether : 1; | 153 bool fCanUseMinAndAbsTogether : 1; |
143 bool fMustForceNegatedAtanParamToFloat : 1; | 154 bool fMustForceNegatedAtanParamToFloat : 1; |
144 | 155 |
145 const char* fVersionDeclString; | 156 const char* fVersionDeclString; |
146 | 157 |
147 const char* fShaderDerivativeExtensionString; | 158 const char* fShaderDerivativeExtensionString; |
148 const char* fFragCoordConventionsExtensionString; | 159 const char* fFragCoordConventionsExtensionString; |
149 const char* fSecondaryOutputExtensionString; | 160 const char* fSecondaryOutputExtensionString; |
150 const char* fExternalTextureExtensionString; | 161 const char* fExternalTextureExtensionString; |
| 162 const char* fNoPerspectiveInterpolationExtensionString; |
151 | 163 |
152 const char* fFBFetchColorName; | 164 const char* fFBFetchColorName; |
153 const char* fFBFetchExtensionString; | 165 const char* fFBFetchExtensionString; |
154 | 166 |
155 AdvBlendEqInteraction fAdvBlendEqInteraction; | 167 AdvBlendEqInteraction fAdvBlendEqInteraction; |
156 | 168 |
157 GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt]; | 169 GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt]; |
158 GrSwizzle fConfigOutputSwizzle[kGrPixelConfigCnt]; | 170 GrSwizzle fConfigOutputSwizzle[kGrPixelConfigCnt]; |
159 | 171 |
160 friend class GrGLCaps; // For initialization. | 172 friend class GrGLCaps; // For initialization. |
161 friend class GrVkCaps; | 173 friend class GrVkCaps; |
162 | 174 |
163 typedef GrShaderCaps INHERITED; | 175 typedef GrShaderCaps INHERITED; |
164 }; | 176 }; |
165 | 177 |
166 #endif | 178 #endif |
OLD | NEW |