jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame^] | 9 | #ifndef GrShaderCaps_DEFINED |
| 10 | #define GrShaderCaps_DEFINED |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 11 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame^] | 12 | #include "../private/GrSwizzle.h" |
| 13 | #include "../private/GrGLSL.h" |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 14 | |
Ethan Nicholas | 7ef4b74 | 2016-11-11 15:16:46 -0500 | [diff] [blame] | 15 | namespace SkSL { |
| 16 | class GLSLCapsFactory; |
| 17 | } |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame^] | 18 | struct GrContextOptions; |
Ethan Nicholas | 7ef4b74 | 2016-11-11 15:16:46 -0500 | [diff] [blame] | 19 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame^] | 20 | class GrShaderCaps : public SkRefCnt { |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 21 | public: |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame^] | 22 | /** Info about shader variable precision within a given shader stage. That is, this info |
| 23 | is relevant to a float (or vecNf) variable declared with a GrSLPrecision |
| 24 | in a given GrShaderType. The info here is hoisted from the OpenGL spec. */ |
| 25 | struct PrecisionInfo { |
| 26 | PrecisionInfo() { |
| 27 | fLogRangeLow = 0; |
| 28 | fLogRangeHigh = 0; |
| 29 | fBits = 0; |
| 30 | } |
| 31 | |
| 32 | /** Is this precision level allowed in the shader stage? */ |
| 33 | bool supported() const { return 0 != fBits; } |
| 34 | |
| 35 | bool operator==(const PrecisionInfo& that) const { |
| 36 | return fLogRangeLow == that.fLogRangeLow && fLogRangeHigh == that.fLogRangeHigh && |
| 37 | fBits == that.fBits; |
| 38 | } |
| 39 | bool operator!=(const PrecisionInfo& that) const { return !(*this == that); } |
| 40 | |
| 41 | /** floor(log2(|min_value|)) */ |
| 42 | int fLogRangeLow; |
| 43 | /** floor(log2(|max_value|)) */ |
| 44 | int fLogRangeHigh; |
| 45 | /** Number of bits of precision. As defined in OpenGL (with names modified to reflect this |
| 46 | struct) : |
| 47 | """ |
| 48 | If the smallest representable value greater than 1 is 1 + e, then fBits will |
| 49 | contain floor(log2(e)), and every value in the range [2^fLogRangeLow, |
| 50 | 2^fLogRangeHigh] can be represented to at least one part in 2^fBits. |
| 51 | """ |
| 52 | */ |
| 53 | int fBits; |
| 54 | }; |
| 55 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 56 | /** |
| 57 | * Indicates how GLSL must interact with advanced blend equations. The KHR extension requires |
| 58 | * special layout qualifiers in the fragment shader. |
| 59 | */ |
| 60 | enum AdvBlendEqInteraction { |
| 61 | kNotSupported_AdvBlendEqInteraction, //<! No _blend_equation_advanced extension |
| 62 | kAutomatic_AdvBlendEqInteraction, //<! No interaction required |
| 63 | kGeneralEnable_AdvBlendEqInteraction, //<! layout(blend_support_all_equations) out |
| 64 | kSpecificEnables_AdvBlendEqInteraction, //<! Specific layout qualifiers per equation |
| 65 | |
| 66 | kLast_AdvBlendEqInteraction = kSpecificEnables_AdvBlendEqInteraction |
| 67 | }; |
| 68 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame^] | 69 | GrShaderCaps(const GrContextOptions&); |
| 70 | |
| 71 | SkString dump() const; |
| 72 | |
| 73 | bool shaderDerivativeSupport() const { return fShaderDerivativeSupport; } |
| 74 | bool geometryShaderSupport() const { return fGeometryShaderSupport; } |
| 75 | bool pathRenderingSupport() const { return fPathRenderingSupport; } |
| 76 | bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } |
| 77 | bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport; } |
| 78 | bool integerSupport() const { return fIntegerSupport; } |
| 79 | bool texelBufferSupport() const { return fTexelBufferSupport; } |
| 80 | int imageLoadStoreSupport() const { return fImageLoadStoreSupport; } |
| 81 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 82 | /** |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame^] | 83 | * Get the precision info for a variable of type kFloat_GrSLType, kVec2f_GrSLType, etc in a |
| 84 | * given shader type. If the shader type is not supported or the precision level is not |
| 85 | * supported in that shader type then the returned struct will report false when supported() is |
| 86 | * called. |
| 87 | */ |
| 88 | const PrecisionInfo& getFloatShaderPrecisionInfo(GrShaderType shaderType, |
| 89 | GrSLPrecision precision) const { |
| 90 | return fFloatPrecisions[shaderType][precision]; |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * Is there any difference between the float shader variable precision types? If this is true |
| 95 | * then unless the shader type is not supported, any call to getFloatShaderPrecisionInfo() would |
| 96 | * report the same info for all precisions in all shader types. |
| 97 | */ |
| 98 | bool floatPrecisionVaries() const { return fShaderPrecisionVaries; } |
| 99 | |
| 100 | /** |
| 101 | * PLS storage size in bytes (0 when not supported). The PLS spec defines a minimum size of 16 |
| 102 | * bytes whenever PLS is supported. |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 103 | */ |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame^] | 104 | int pixelLocalStorageSize() const { return fPixelLocalStorageSize; } |
| 105 | |
| 106 | /** |
| 107 | * True if this context supports the necessary extensions and features to enable the PLS path |
| 108 | * renderer. |
| 109 | */ |
| 110 | bool plsPathRenderingSupport() const { |
| 111 | #if GR_ENABLE_PLS_PATH_RENDERING |
| 112 | return fPLSPathRenderingSupport; |
| 113 | #else |
| 114 | return false; |
| 115 | #endif |
| 116 | } |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 117 | |
| 118 | /** |
| 119 | * Some helper functions for encapsulating various extensions to read FB Buffer on openglES |
| 120 | * |
| 121 | * TODO(joshualitt) On desktop opengl 4.2+ we can achieve something similar to this effect |
| 122 | */ |
| 123 | bool fbFetchSupport() const { return fFBFetchSupport; } |
| 124 | |
| 125 | bool fbFetchNeedsCustomOutput() const { return fFBFetchNeedsCustomOutput; } |
| 126 | |
| 127 | bool bindlessTextureSupport() const { return fBindlessTextureSupport; } |
| 128 | |
egdaniel | 472d44e | 2015-10-22 08:20:00 -0700 | [diff] [blame] | 129 | const char* versionDeclString() const { return fVersionDeclString; } |
| 130 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 131 | const char* fbFetchColorName() const { return fFBFetchColorName; } |
| 132 | |
| 133 | const char* fbFetchExtensionString() const { return fFBFetchExtensionString; } |
| 134 | |
| 135 | bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } |
| 136 | |
cdalton | c08f196 | 2016-02-12 12:14:06 -0800 | [diff] [blame] | 137 | bool flatInterpolationSupport() const { return fFlatInterpolationSupport; } |
| 138 | |
| 139 | bool noperspectiveInterpolationSupport() const { return fNoPerspectiveInterpolationSupport; } |
| 140 | |
cdalton | 4a98cdb | 2016-03-01 12:12:20 -0800 | [diff] [blame] | 141 | bool multisampleInterpolationSupport() const { return fMultisampleInterpolationSupport; } |
| 142 | |
cdalton | 33ad701 | 2016-02-22 07:55:44 -0800 | [diff] [blame] | 143 | bool sampleVariablesSupport() const { return fSampleVariablesSupport; } |
| 144 | |
| 145 | bool sampleMaskOverrideCoverageSupport() const { return fSampleMaskOverrideCoverageSupport; } |
| 146 | |
cdalton | 9c3f143 | 2016-03-11 10:07:37 -0800 | [diff] [blame] | 147 | bool externalTextureSupport() const { return fExternalTextureSupport; } |
| 148 | |
cdalton | f8a6ce8 | 2016-04-11 13:02:05 -0700 | [diff] [blame] | 149 | bool texelFetchSupport() const { return fTexelFetchSupport; } |
cdalton | c04ce67 | 2016-03-11 14:07:38 -0800 | [diff] [blame] | 150 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 151 | AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInteraction; } |
| 152 | |
| 153 | bool mustEnableAdvBlendEqs() const { |
| 154 | return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction; |
| 155 | } |
| 156 | |
| 157 | bool mustEnableSpecificAdvBlendEqs() const { |
| 158 | return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction; |
| 159 | } |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 160 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 161 | bool mustDeclareFragmentShaderOutput() const { |
| 162 | return fGLSLGeneration > k110_GrGLSLGeneration; |
| 163 | } |
| 164 | |
egdaniel | f529439 | 2015-10-21 07:14:17 -0700 | [diff] [blame] | 165 | bool usesPrecisionModifiers() const { return fUsesPrecisionModifiers; } |
| 166 | |
egdaniel | 472d44e | 2015-10-22 08:20:00 -0700 | [diff] [blame] | 167 | // Returns whether we can use the glsl funciton any() in our shader code. |
| 168 | bool canUseAnyFunctionInShader() const { return fCanUseAnyFunctionInShader; } |
| 169 | |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 170 | bool canUseMinAndAbsTogether() const { return fCanUseMinAndAbsTogether; } |
| 171 | |
| 172 | bool mustForceNegatedAtanParamToFloat() const { return fMustForceNegatedAtanParamToFloat; } |
| 173 | |
egdaniel | 138c263 | 2016-08-17 10:59:00 -0700 | [diff] [blame] | 174 | bool requiresLocalOutputColorForFBFetch() const { return fRequiresLocalOutputColorForFBFetch; } |
| 175 | |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 176 | // Returns the string of an extension that must be enabled in the shader to support |
| 177 | // derivatives. If nullptr is returned then no extension needs to be enabled. Before calling |
| 178 | // this function, the caller should check that shaderDerivativeSupport exists. |
| 179 | const char* shaderDerivativeExtensionString() const { |
| 180 | SkASSERT(this->shaderDerivativeSupport()); |
| 181 | return fShaderDerivativeExtensionString; |
| 182 | } |
cdalton | 33ad701 | 2016-02-22 07:55:44 -0800 | [diff] [blame] | 183 | |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 184 | // Returns the string of an extension that will do all necessary coord transfomations needed |
| 185 | // when reading the fragment position. If such an extension does not exisits, this function |
| 186 | // returns a nullptr, and all transforms of the frag position must be done manually in the |
| 187 | // shader. |
| 188 | const char* fragCoordConventionsExtensionString() const { |
| 189 | return fFragCoordConventionsExtensionString; |
| 190 | } |
| 191 | |
| 192 | // This returns the name of an extension that must be enabled in the shader, if such a thing is |
| 193 | // required in order to use a secondary output in the shader. This returns a nullptr if no such |
| 194 | // extension is required. However, the return value of this function does not say whether dual |
| 195 | // source blending is supported. |
| 196 | const char* secondaryOutputExtensionString() const { |
| 197 | return fSecondaryOutputExtensionString; |
| 198 | } |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 199 | |
bsalomon | 7ea33f5 | 2015-11-22 14:51:00 -0800 | [diff] [blame] | 200 | const char* externalTextureExtensionString() const { |
cdalton | 9c3f143 | 2016-03-11 10:07:37 -0800 | [diff] [blame] | 201 | SkASSERT(this->externalTextureSupport()); |
bsalomon | 7ea33f5 | 2015-11-22 14:51:00 -0800 | [diff] [blame] | 202 | return fExternalTextureExtensionString; |
| 203 | } |
| 204 | |
cdalton | f8a6ce8 | 2016-04-11 13:02:05 -0700 | [diff] [blame] | 205 | const char* texelBufferExtensionString() const { |
| 206 | SkASSERT(this->texelBufferSupport()); |
| 207 | return fTexelBufferExtensionString; |
cdalton | c04ce67 | 2016-03-11 14:07:38 -0800 | [diff] [blame] | 208 | } |
| 209 | |
cdalton | c08f196 | 2016-02-12 12:14:06 -0800 | [diff] [blame] | 210 | const char* noperspectiveInterpolationExtensionString() const { |
| 211 | SkASSERT(this->noperspectiveInterpolationSupport()); |
| 212 | return fNoPerspectiveInterpolationExtensionString; |
| 213 | } |
| 214 | |
cdalton | 4a98cdb | 2016-03-01 12:12:20 -0800 | [diff] [blame] | 215 | const char* multisampleInterpolationExtensionString() const { |
| 216 | SkASSERT(this->multisampleInterpolationSupport()); |
| 217 | return fMultisampleInterpolationExtensionString; |
| 218 | } |
| 219 | |
cdalton | 33ad701 | 2016-02-22 07:55:44 -0800 | [diff] [blame] | 220 | const char* sampleVariablesExtensionString() const { |
| 221 | SkASSERT(this->sampleVariablesSupport()); |
| 222 | return fSampleVariablesExtensionString; |
| 223 | } |
| 224 | |
Brian Salomon | f26f7a0 | 2016-11-15 14:05:01 -0500 | [diff] [blame] | 225 | const char* imageLoadStoreExtensionString() const { |
| 226 | SkASSERT(this->imageLoadStoreSupport()); |
| 227 | return fImageLoadStoreExtensionString; |
| 228 | } |
| 229 | |
cdalton | 9c3f143 | 2016-03-11 10:07:37 -0800 | [diff] [blame] | 230 | int maxVertexSamplers() const { return fMaxVertexSamplers; } |
| 231 | |
| 232 | int maxGeometrySamplers() const { return fMaxGeometrySamplers; } |
| 233 | |
| 234 | int maxFragmentSamplers() const { return fMaxFragmentSamplers; } |
| 235 | |
| 236 | int maxCombinedSamplers() const { return fMaxCombinedSamplers; } |
| 237 | |
Brian Salomon | f9f4512 | 2016-11-29 11:59:17 -0500 | [diff] [blame] | 238 | int maxVertexImageStorages() const { return fMaxVertexImageStorages; } |
Brian Salomon | f26f7a0 | 2016-11-15 14:05:01 -0500 | [diff] [blame] | 239 | |
Brian Salomon | f9f4512 | 2016-11-29 11:59:17 -0500 | [diff] [blame] | 240 | int maxGeometryImageStorages() const { return fMaxGeometryImageStorages; } |
Brian Salomon | f26f7a0 | 2016-11-15 14:05:01 -0500 | [diff] [blame] | 241 | |
Brian Salomon | f9f4512 | 2016-11-29 11:59:17 -0500 | [diff] [blame] | 242 | int maxFragmentImageStorages() const { return fMaxFragmentImageStorages; } |
Brian Salomon | f26f7a0 | 2016-11-15 14:05:01 -0500 | [diff] [blame] | 243 | |
Brian Salomon | f9f4512 | 2016-11-29 11:59:17 -0500 | [diff] [blame] | 244 | int maxCombinedImageStorages() const { return fMaxCombinedImageStorages; } |
Brian Salomon | f26f7a0 | 2016-11-15 14:05:01 -0500 | [diff] [blame] | 245 | |
egdaniel | b7e7d57 | 2015-11-04 04:23:53 -0800 | [diff] [blame] | 246 | /** |
bsalomon | cdee009 | 2016-01-08 13:20:12 -0800 | [diff] [blame] | 247 | * Given a texture's config, this determines what swizzle must be appended to accesses to the |
| 248 | * texture in generated shader code. Swizzling may be implemented in texture parameters or a |
bsalomon | 7f9b2e4 | 2016-01-12 13:29:26 -0800 | [diff] [blame] | 249 | * sampler rather than in the shader. In this case the returned swizzle will always be "rgba". |
egdaniel | b7e7d57 | 2015-11-04 04:23:53 -0800 | [diff] [blame] | 250 | */ |
bsalomon | cdee009 | 2016-01-08 13:20:12 -0800 | [diff] [blame] | 251 | const GrSwizzle& configTextureSwizzle(GrPixelConfig config) const { |
| 252 | return fConfigTextureSwizzle[config]; |
| 253 | } |
egdaniel | b7e7d57 | 2015-11-04 04:23:53 -0800 | [diff] [blame] | 254 | |
bsalomon | 7f9b2e4 | 2016-01-12 13:29:26 -0800 | [diff] [blame] | 255 | /** Swizzle that should occur on the fragment shader outputs for a given config. */ |
| 256 | const GrSwizzle& configOutputSwizzle(GrPixelConfig config) const { |
| 257 | return fConfigOutputSwizzle[config]; |
| 258 | } |
| 259 | |
cdalton | a6b92ad | 2016-04-11 12:03:08 -0700 | [diff] [blame] | 260 | /** Precision qualifier that should be used with a sampler, given its config and visibility. */ |
| 261 | GrSLPrecision samplerPrecision(GrPixelConfig config, GrShaderFlags visibility) const { |
| 262 | return static_cast<GrSLPrecision>(fSamplerPrecisions[visibility][config]); |
| 263 | } |
| 264 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 265 | GrGLSLGeneration generation() const { return fGLSLGeneration; } |
| 266 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 267 | private: |
cdalton | a6b92ad | 2016-04-11 12:03:08 -0700 | [diff] [blame] | 268 | /** GrCaps subclasses must call this after filling in the shader precision table. */ |
| 269 | void initSamplerPrecisionTable(); |
| 270 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame^] | 271 | void applyOptionsOverrides(const GrContextOptions& options); |
egdaniel | b7e7d57 | 2015-11-04 04:23:53 -0800 | [diff] [blame] | 272 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 273 | GrGLSLGeneration fGLSLGeneration; |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 274 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame^] | 275 | bool fShaderDerivativeSupport : 1; |
| 276 | bool fGeometryShaderSupport : 1; |
| 277 | bool fPathRenderingSupport : 1; |
| 278 | bool fDstReadInShaderSupport : 1; |
| 279 | bool fDualSourceBlendingSupport : 1; |
| 280 | bool fIntegerSupport : 1; |
| 281 | bool fTexelBufferSupport : 1; |
| 282 | bool fImageLoadStoreSupport : 1; |
| 283 | bool fPLSPathRenderingSupport : 1; |
| 284 | bool fShaderPrecisionVaries : 1; |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 285 | bool fDropsTileOnZeroDivide : 1; |
| 286 | bool fFBFetchSupport : 1; |
| 287 | bool fFBFetchNeedsCustomOutput : 1; |
| 288 | bool fBindlessTextureSupport : 1; |
egdaniel | f529439 | 2015-10-21 07:14:17 -0700 | [diff] [blame] | 289 | bool fUsesPrecisionModifiers : 1; |
egdaniel | 472d44e | 2015-10-22 08:20:00 -0700 | [diff] [blame] | 290 | bool fCanUseAnyFunctionInShader : 1; |
cdalton | c08f196 | 2016-02-12 12:14:06 -0800 | [diff] [blame] | 291 | bool fFlatInterpolationSupport : 1; |
| 292 | bool fNoPerspectiveInterpolationSupport : 1; |
cdalton | 4a98cdb | 2016-03-01 12:12:20 -0800 | [diff] [blame] | 293 | bool fMultisampleInterpolationSupport : 1; |
cdalton | 33ad701 | 2016-02-22 07:55:44 -0800 | [diff] [blame] | 294 | bool fSampleVariablesSupport : 1; |
| 295 | bool fSampleMaskOverrideCoverageSupport : 1; |
cdalton | 9c3f143 | 2016-03-11 10:07:37 -0800 | [diff] [blame] | 296 | bool fExternalTextureSupport : 1; |
cdalton | f8a6ce8 | 2016-04-11 13:02:05 -0700 | [diff] [blame] | 297 | bool fTexelFetchSupport : 1; |
egdaniel | f529439 | 2015-10-21 07:14:17 -0700 | [diff] [blame] | 298 | |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 299 | // Used for specific driver bug work arounds |
| 300 | bool fCanUseMinAndAbsTogether : 1; |
| 301 | bool fMustForceNegatedAtanParamToFloat : 1; |
egdaniel | 138c263 | 2016-08-17 10:59:00 -0700 | [diff] [blame] | 302 | bool fRequiresLocalOutputColorForFBFetch : 1; |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 303 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame^] | 304 | PrecisionInfo fFloatPrecisions[kGrShaderTypeCount][kGrSLPrecisionCount]; |
| 305 | int fPixelLocalStorageSize; |
| 306 | |
egdaniel | 472d44e | 2015-10-22 08:20:00 -0700 | [diff] [blame] | 307 | const char* fVersionDeclString; |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 308 | |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 309 | const char* fShaderDerivativeExtensionString; |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 310 | const char* fFragCoordConventionsExtensionString; |
| 311 | const char* fSecondaryOutputExtensionString; |
bsalomon | 7ea33f5 | 2015-11-22 14:51:00 -0800 | [diff] [blame] | 312 | const char* fExternalTextureExtensionString; |
cdalton | f8a6ce8 | 2016-04-11 13:02:05 -0700 | [diff] [blame] | 313 | const char* fTexelBufferExtensionString; |
cdalton | c08f196 | 2016-02-12 12:14:06 -0800 | [diff] [blame] | 314 | const char* fNoPerspectiveInterpolationExtensionString; |
cdalton | 4a98cdb | 2016-03-01 12:12:20 -0800 | [diff] [blame] | 315 | const char* fMultisampleInterpolationExtensionString; |
cdalton | 33ad701 | 2016-02-22 07:55:44 -0800 | [diff] [blame] | 316 | const char* fSampleVariablesExtensionString; |
Brian Salomon | f26f7a0 | 2016-11-15 14:05:01 -0500 | [diff] [blame] | 317 | const char* fImageLoadStoreExtensionString; |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 318 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 319 | const char* fFBFetchColorName; |
| 320 | const char* fFBFetchExtensionString; |
| 321 | |
jvanverth | e78d487 | 2016-09-27 03:33:05 -0700 | [diff] [blame] | 322 | int fMaxVertexSamplers; |
| 323 | int fMaxGeometrySamplers; |
| 324 | int fMaxFragmentSamplers; |
| 325 | int fMaxCombinedSamplers; |
cdalton | 9c3f143 | 2016-03-11 10:07:37 -0800 | [diff] [blame] | 326 | |
Brian Salomon | f9f4512 | 2016-11-29 11:59:17 -0500 | [diff] [blame] | 327 | int fMaxVertexImageStorages; |
| 328 | int fMaxGeometryImageStorages; |
| 329 | int fMaxFragmentImageStorages; |
| 330 | int fMaxCombinedImageStorages; |
Brian Salomon | f26f7a0 | 2016-11-15 14:05:01 -0500 | [diff] [blame] | 331 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 332 | AdvBlendEqInteraction fAdvBlendEqInteraction; |
| 333 | |
bsalomon | cdee009 | 2016-01-08 13:20:12 -0800 | [diff] [blame] | 334 | GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt]; |
bsalomon | 7f9b2e4 | 2016-01-12 13:29:26 -0800 | [diff] [blame] | 335 | GrSwizzle fConfigOutputSwizzle[kGrPixelConfigCnt]; |
egdaniel | b7e7d57 | 2015-11-04 04:23:53 -0800 | [diff] [blame] | 336 | |
cdalton | a6b92ad | 2016-04-11 12:03:08 -0700 | [diff] [blame] | 337 | uint8_t fSamplerPrecisions[(1 << kGrShaderTypeCount)][kGrPixelConfigCnt]; |
| 338 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 339 | friend class GrGLCaps; // For initialization. |
egdaniel | fa89632 | 2016-01-13 12:19:30 -0800 | [diff] [blame] | 340 | friend class GrVkCaps; |
Ethan Nicholas | 7ef4b74 | 2016-11-11 15:16:46 -0500 | [diff] [blame] | 341 | friend class SkSL::GLSLCapsFactory; |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 342 | }; |
| 343 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 344 | #endif |