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 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 8 | #ifndef GrShaderCaps_DEFINED |
| 9 | #define GrShaderCaps_DEFINED |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 10 | |
Brian Salomon | 0560bd6 | 2018-06-19 14:19:13 -0400 | [diff] [blame] | 11 | #include "GrSwizzle.h" |
Brian Salomon | 23c55b6 | 2018-06-19 16:28:41 -0400 | [diff] [blame] | 12 | #include "GrTypesPriv.h" |
| 13 | #include "SkRefCnt.h" |
| 14 | #include "glsl/GrGLSL.h" |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 15 | |
Ethan Nicholas | 7ef4b74 | 2016-11-11 15:16:46 -0500 | [diff] [blame] | 16 | namespace SkSL { |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 17 | class ShaderCapsFactory; |
Ethan Nicholas | 7ef4b74 | 2016-11-11 15:16:46 -0500 | [diff] [blame] | 18 | } |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 19 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 20 | struct GrContextOptions; |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 21 | class SkJSONWriter; |
Ethan Nicholas | 7ef4b74 | 2016-11-11 15:16:46 -0500 | [diff] [blame] | 22 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 23 | class GrShaderCaps : public SkRefCnt { |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 24 | public: |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 25 | /** |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 26 | * Indicates how GLSL must interact with advanced blend equations. The KHR extension requires |
| 27 | * special layout qualifiers in the fragment shader. |
| 28 | */ |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 29 | enum AdvBlendEqInteraction { |
| 30 | kNotSupported_AdvBlendEqInteraction, //<! No _blend_equation_advanced extension |
| 31 | kAutomatic_AdvBlendEqInteraction, //<! No interaction required |
| 32 | kGeneralEnable_AdvBlendEqInteraction, //<! layout(blend_support_all_equations) out |
| 33 | kSpecificEnables_AdvBlendEqInteraction, //<! Specific layout qualifiers per equation |
| 34 | |
| 35 | kLast_AdvBlendEqInteraction = kSpecificEnables_AdvBlendEqInteraction |
| 36 | }; |
| 37 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 38 | GrShaderCaps(const GrContextOptions&); |
| 39 | |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 40 | void dumpJSON(SkJSONWriter*) const; |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 41 | |
Khushal | 3e7548c | 2018-05-23 15:45:01 -0700 | [diff] [blame] | 42 | bool supportsDistanceFieldText() const { return fShaderDerivativeSupport; } |
| 43 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 44 | bool shaderDerivativeSupport() const { return fShaderDerivativeSupport; } |
| 45 | bool geometryShaderSupport() const { return fGeometryShaderSupport; } |
Chris Dalton | f1b47bb | 2017-10-06 11:57:51 -0600 | [diff] [blame] | 46 | bool gsInvocationsSupport() const { return fGSInvocationsSupport; } |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 47 | bool pathRenderingSupport() const { return fPathRenderingSupport; } |
| 48 | bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } |
| 49 | bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport; } |
| 50 | bool integerSupport() const { return fIntegerSupport; } |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 51 | int imageLoadStoreSupport() const { return fImageLoadStoreSupport; } |
| 52 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 53 | /** |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 54 | * Some helper functions for encapsulating various extensions to read FB Buffer on openglES |
| 55 | * |
| 56 | * TODO(joshualitt) On desktop opengl 4.2+ we can achieve something similar to this effect |
| 57 | */ |
| 58 | bool fbFetchSupport() const { return fFBFetchSupport; } |
| 59 | |
| 60 | bool fbFetchNeedsCustomOutput() const { return fFBFetchNeedsCustomOutput; } |
| 61 | |
egdaniel | 472d44e | 2015-10-22 08:20:00 -0700 | [diff] [blame] | 62 | const char* versionDeclString() const { return fVersionDeclString; } |
| 63 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 64 | const char* fbFetchColorName() const { return fFBFetchColorName; } |
| 65 | |
| 66 | const char* fbFetchExtensionString() const { return fFBFetchExtensionString; } |
| 67 | |
| 68 | bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } |
| 69 | |
cdalton | c08f196 | 2016-02-12 12:14:06 -0800 | [diff] [blame] | 70 | bool flatInterpolationSupport() const { return fFlatInterpolationSupport; } |
| 71 | |
Brian Salomon | 4127456 | 2017-09-15 09:40:03 -0700 | [diff] [blame] | 72 | bool preferFlatInterpolation() const { return fPreferFlatInterpolation; } |
| 73 | |
cdalton | c08f196 | 2016-02-12 12:14:06 -0800 | [diff] [blame] | 74 | bool noperspectiveInterpolationSupport() const { return fNoPerspectiveInterpolationSupport; } |
| 75 | |
cdalton | 9c3f143 | 2016-03-11 10:07:37 -0800 | [diff] [blame] | 76 | bool externalTextureSupport() const { return fExternalTextureSupport; } |
| 77 | |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 78 | bool vertexIDSupport() const { return fVertexIDSupport; } |
| 79 | |
Chris Dalton | 7c7ff03 | 2018-03-28 20:09:58 -0600 | [diff] [blame] | 80 | // frexp, ldexp, etc. |
| 81 | bool fpManipulationSupport() const { return fFPManipulationSupport; } |
| 82 | |
Chris Dalton | 47c8ed3 | 2017-11-15 18:27:09 -0700 | [diff] [blame] | 83 | bool floatIs32Bits() const { return fFloatIs32Bits; } |
| 84 | |
| 85 | bool halfIs32Bits() const { return fHalfIs32Bits; } |
| 86 | |
Ruiqi Mao | b609e6d | 2018-07-17 10:19:38 -0400 | [diff] [blame^] | 87 | bool unsignedSupport() const { return fUnsignedSupport; } |
| 88 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 89 | AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInteraction; } |
| 90 | |
| 91 | bool mustEnableAdvBlendEqs() const { |
| 92 | return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction; |
| 93 | } |
| 94 | |
| 95 | bool mustEnableSpecificAdvBlendEqs() const { |
| 96 | return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction; |
| 97 | } |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 98 | |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 99 | bool mustDeclareFragmentShaderOutput() const { return fGLSLGeneration > k110_GrGLSLGeneration; } |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 100 | |
egdaniel | f529439 | 2015-10-21 07:14:17 -0700 | [diff] [blame] | 101 | bool usesPrecisionModifiers() const { return fUsesPrecisionModifiers; } |
| 102 | |
Greg Daniel | 80a08dd | 2017-01-20 10:45:49 -0500 | [diff] [blame] | 103 | // Returns whether we can use the glsl function any() in our shader code. |
egdaniel | 472d44e | 2015-10-22 08:20:00 -0700 | [diff] [blame] | 104 | bool canUseAnyFunctionInShader() const { return fCanUseAnyFunctionInShader; } |
| 105 | |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 106 | bool canUseMinAndAbsTogether() const { return fCanUseMinAndAbsTogether; } |
| 107 | |
Florin Malita | 8a0044f | 2017-08-07 14:38:22 -0400 | [diff] [blame] | 108 | bool canUseFractForNegativeValues() const { return fCanUseFractForNegativeValues; } |
| 109 | |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 110 | bool mustForceNegatedAtanParamToFloat() const { return fMustForceNegatedAtanParamToFloat; } |
| 111 | |
Greg Daniel | 80a08dd | 2017-01-20 10:45:49 -0500 | [diff] [blame] | 112 | // Returns whether a device incorrectly implements atan(y,x) as atan(y/x) |
| 113 | bool atan2ImplementedAsAtanYOverX() const { return fAtan2ImplementedAsAtanYOverX; } |
| 114 | |
Greg Daniel | 10ed243 | 2017-12-01 16:19:43 -0500 | [diff] [blame] | 115 | // If this returns true some operation (could be a no op) must be called between floor and abs |
| 116 | // to make sure the driver compiler doesn't inline them together which can cause a driver bug in |
| 117 | // the shader. |
| 118 | bool mustDoOpBetweenFloorAndAbs() const { return fMustDoOpBetweenFloorAndAbs; } |
| 119 | |
Brian Osman | cd3261a | 2018-01-16 13:52:29 +0000 | [diff] [blame] | 120 | // If false, SkSL uses a workaround so that sk_FragCoord doesn't actually query gl_FragCoord |
| 121 | bool canUseFragCoord() const { return fCanUseFragCoord; } |
| 122 | |
Chris Dalton | c2d0dd6 | 2018-03-07 07:46:10 -0700 | [diff] [blame] | 123 | // If true, short ints can't represent every integer in the 16-bit two's complement range as |
| 124 | // required by the spec. SKSL will always emit full ints. |
| 125 | bool incompleteShortIntPrecision() const { return fIncompleteShortIntPrecision; } |
| 126 | |
egdaniel | 138c263 | 2016-08-17 10:59:00 -0700 | [diff] [blame] | 127 | bool requiresLocalOutputColorForFBFetch() const { return fRequiresLocalOutputColorForFBFetch; } |
| 128 | |
Brian Osman | ac1e496 | 2017-05-25 11:34:38 -0400 | [diff] [blame] | 129 | bool mustObfuscateUniformColor() const { return fMustObfuscateUniformColor; } |
| 130 | |
Brian Osman | dff5d43 | 2017-08-01 14:46:18 -0400 | [diff] [blame] | 131 | // The D3D shader compiler, when targeting PS 3.0 (ie within ANGLE) fails to compile certain |
| 132 | // constructs. See detailed comments in GrGLCaps.cpp. |
| 133 | bool mustGuardDivisionEvenAfterExplicitZeroCheck() const { |
| 134 | return fMustGuardDivisionEvenAfterExplicitZeroCheck; |
| 135 | } |
| 136 | |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 137 | // Returns the string of an extension that must be enabled in the shader to support |
| 138 | // derivatives. If nullptr is returned then no extension needs to be enabled. Before calling |
| 139 | // this function, the caller should check that shaderDerivativeSupport exists. |
| 140 | const char* shaderDerivativeExtensionString() const { |
| 141 | SkASSERT(this->shaderDerivativeSupport()); |
| 142 | return fShaderDerivativeExtensionString; |
| 143 | } |
cdalton | 33ad701 | 2016-02-22 07:55:44 -0800 | [diff] [blame] | 144 | |
Chris Dalton | 8fd7955 | 2018-01-11 00:46:14 -0500 | [diff] [blame] | 145 | // Returns the string of an extension that must be enabled in the shader to support geometry |
| 146 | // shaders. If nullptr is returned then no extension needs to be enabled. Before calling this |
| 147 | // function, the caller must verify that geometryShaderSupport exists. |
| 148 | const char* geometryShaderExtensionString() const { |
| 149 | SkASSERT(this->geometryShaderSupport()); |
| 150 | return fGeometryShaderExtensionString; |
| 151 | } |
| 152 | |
Chris Dalton | f1b47bb | 2017-10-06 11:57:51 -0600 | [diff] [blame] | 153 | // Returns the string of an extension that must be enabled in the shader to support |
| 154 | // geometry shader invocations. If nullptr is returned then no extension needs to be enabled. |
| 155 | // Before calling this function, the caller must verify that gsInvocationsSupport exists. |
| 156 | const char* gsInvocationsExtensionString() const { |
| 157 | SkASSERT(this->gsInvocationsSupport()); |
| 158 | return fGSInvocationsExtensionString; |
| 159 | } |
| 160 | |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 161 | // Returns the string of an extension that will do all necessary coord transfomations needed |
| 162 | // when reading the fragment position. If such an extension does not exisits, this function |
| 163 | // returns a nullptr, and all transforms of the frag position must be done manually in the |
| 164 | // shader. |
| 165 | const char* fragCoordConventionsExtensionString() const { |
| 166 | return fFragCoordConventionsExtensionString; |
| 167 | } |
| 168 | |
| 169 | // This returns the name of an extension that must be enabled in the shader, if such a thing is |
| 170 | // required in order to use a secondary output in the shader. This returns a nullptr if no such |
| 171 | // extension is required. However, the return value of this function does not say whether dual |
| 172 | // source blending is supported. |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 173 | const char* secondaryOutputExtensionString() const { return fSecondaryOutputExtensionString; } |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 174 | |
Brian Osman | 061020e | 2018-04-17 14:22:15 -0400 | [diff] [blame] | 175 | // This returns the name of an extension that must be enabled in the shader to support external |
| 176 | // textures. In some cases, two extensions must be enabled - the second extension is returned |
| 177 | // by secondExternalTextureExtensionString(). If that function returns nullptr, then only one |
| 178 | // extension is required. |
bsalomon | 7ea33f5 | 2015-11-22 14:51:00 -0800 | [diff] [blame] | 179 | const char* externalTextureExtensionString() const { |
cdalton | 9c3f143 | 2016-03-11 10:07:37 -0800 | [diff] [blame] | 180 | SkASSERT(this->externalTextureSupport()); |
bsalomon | 7ea33f5 | 2015-11-22 14:51:00 -0800 | [diff] [blame] | 181 | return fExternalTextureExtensionString; |
| 182 | } |
| 183 | |
Brian Osman | 061020e | 2018-04-17 14:22:15 -0400 | [diff] [blame] | 184 | const char* secondExternalTextureExtensionString() const { |
| 185 | SkASSERT(this->externalTextureSupport()); |
| 186 | return fSecondExternalTextureExtensionString; |
| 187 | } |
| 188 | |
cdalton | c08f196 | 2016-02-12 12:14:06 -0800 | [diff] [blame] | 189 | const char* noperspectiveInterpolationExtensionString() const { |
| 190 | SkASSERT(this->noperspectiveInterpolationSupport()); |
| 191 | return fNoPerspectiveInterpolationExtensionString; |
| 192 | } |
| 193 | |
Brian Salomon | f26f7a0 | 2016-11-15 14:05:01 -0500 | [diff] [blame] | 194 | const char* imageLoadStoreExtensionString() const { |
| 195 | SkASSERT(this->imageLoadStoreSupport()); |
| 196 | return fImageLoadStoreExtensionString; |
| 197 | } |
| 198 | |
cdalton | 9c3f143 | 2016-03-11 10:07:37 -0800 | [diff] [blame] | 199 | int maxVertexSamplers() const { return fMaxVertexSamplers; } |
| 200 | |
| 201 | int maxGeometrySamplers() const { return fMaxGeometrySamplers; } |
| 202 | |
| 203 | int maxFragmentSamplers() const { return fMaxFragmentSamplers; } |
| 204 | |
| 205 | int maxCombinedSamplers() const { return fMaxCombinedSamplers; } |
| 206 | |
Brian Salomon | 762d5e7 | 2017-12-01 10:25:08 -0500 | [diff] [blame] | 207 | /** |
| 208 | * In general using multiple texture units for image rendering seems to be a win at smaller |
| 209 | * sizes of dst rects and a loss at larger sizes. Dst rects above this pixel area threshold will |
| 210 | * not use multitexturing. |
| 211 | */ |
| 212 | size_t disableImageMultitexturingDstRectAreaThreshold() const { |
| 213 | return fDisableImageMultitexturingDstRectAreaThreshold; |
| 214 | } |
Brian Salomon | 0b4d8aa | 2017-10-11 15:34:27 -0400 | [diff] [blame] | 215 | |
egdaniel | b7e7d57 | 2015-11-04 04:23:53 -0800 | [diff] [blame] | 216 | /** |
bsalomon | cdee009 | 2016-01-08 13:20:12 -0800 | [diff] [blame] | 217 | * Given a texture's config, this determines what swizzle must be appended to accesses to the |
| 218 | * 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] | 219 | * 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] | 220 | */ |
bsalomon | cdee009 | 2016-01-08 13:20:12 -0800 | [diff] [blame] | 221 | const GrSwizzle& configTextureSwizzle(GrPixelConfig config) const { |
| 222 | return fConfigTextureSwizzle[config]; |
| 223 | } |
egdaniel | b7e7d57 | 2015-11-04 04:23:53 -0800 | [diff] [blame] | 224 | |
bsalomon | 7f9b2e4 | 2016-01-12 13:29:26 -0800 | [diff] [blame] | 225 | /** Swizzle that should occur on the fragment shader outputs for a given config. */ |
| 226 | const GrSwizzle& configOutputSwizzle(GrPixelConfig config) const { |
| 227 | return fConfigOutputSwizzle[config]; |
| 228 | } |
| 229 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 230 | GrGLSLGeneration generation() const { return fGLSLGeneration; } |
| 231 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 232 | private: |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 233 | void applyOptionsOverrides(const GrContextOptions& options); |
egdaniel | b7e7d57 | 2015-11-04 04:23:53 -0800 | [diff] [blame] | 234 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 235 | GrGLSLGeneration fGLSLGeneration; |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 236 | |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 237 | bool fShaderDerivativeSupport : 1; |
| 238 | bool fGeometryShaderSupport : 1; |
| 239 | bool fGSInvocationsSupport : 1; |
| 240 | bool fPathRenderingSupport : 1; |
| 241 | bool fDstReadInShaderSupport : 1; |
| 242 | bool fDualSourceBlendingSupport : 1; |
| 243 | bool fIntegerSupport : 1; |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 244 | bool fImageLoadStoreSupport : 1; |
| 245 | bool fDropsTileOnZeroDivide : 1; |
| 246 | bool fFBFetchSupport : 1; |
| 247 | bool fFBFetchNeedsCustomOutput : 1; |
| 248 | bool fUsesPrecisionModifiers : 1; |
| 249 | bool fFlatInterpolationSupport : 1; |
| 250 | bool fPreferFlatInterpolation : 1; |
cdalton | c08f196 | 2016-02-12 12:14:06 -0800 | [diff] [blame] | 251 | bool fNoPerspectiveInterpolationSupport : 1; |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 252 | bool fExternalTextureSupport : 1; |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 253 | bool fVertexIDSupport : 1; |
| 254 | bool fFPManipulationSupport : 1; |
| 255 | bool fFloatIs32Bits : 1; |
| 256 | bool fHalfIs32Bits : 1; |
Ruiqi Mao | b609e6d | 2018-07-17 10:19:38 -0400 | [diff] [blame^] | 257 | bool fUnsignedSupport : 1; |
egdaniel | f529439 | 2015-10-21 07:14:17 -0700 | [diff] [blame] | 258 | |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 259 | // Used for specific driver bug work arounds |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 260 | bool fCanUseAnyFunctionInShader : 1; |
| 261 | bool fCanUseMinAndAbsTogether : 1; |
| 262 | bool fCanUseFractForNegativeValues : 1; |
| 263 | bool fMustForceNegatedAtanParamToFloat : 1; |
| 264 | bool fAtan2ImplementedAsAtanYOverX : 1; |
| 265 | bool fMustDoOpBetweenFloorAndAbs : 1; |
| 266 | bool fRequiresLocalOutputColorForFBFetch : 1; |
| 267 | bool fMustObfuscateUniformColor : 1; |
Brian Osman | dff5d43 | 2017-08-01 14:46:18 -0400 | [diff] [blame] | 268 | bool fMustGuardDivisionEvenAfterExplicitZeroCheck : 1; |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 269 | bool fCanUseFragCoord : 1; |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 270 | bool fIncompleteShortIntPrecision : 1; |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 271 | |
egdaniel | 472d44e | 2015-10-22 08:20:00 -0700 | [diff] [blame] | 272 | const char* fVersionDeclString; |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 273 | |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 274 | const char* fShaderDerivativeExtensionString; |
Chris Dalton | 8fd7955 | 2018-01-11 00:46:14 -0500 | [diff] [blame] | 275 | const char* fGeometryShaderExtensionString; |
Chris Dalton | f1b47bb | 2017-10-06 11:57:51 -0600 | [diff] [blame] | 276 | const char* fGSInvocationsExtensionString; |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 277 | const char* fFragCoordConventionsExtensionString; |
| 278 | const char* fSecondaryOutputExtensionString; |
bsalomon | 7ea33f5 | 2015-11-22 14:51:00 -0800 | [diff] [blame] | 279 | const char* fExternalTextureExtensionString; |
Brian Osman | 061020e | 2018-04-17 14:22:15 -0400 | [diff] [blame] | 280 | const char* fSecondExternalTextureExtensionString; |
cdalton | c08f196 | 2016-02-12 12:14:06 -0800 | [diff] [blame] | 281 | const char* fNoPerspectiveInterpolationExtensionString; |
Brian Salomon | f26f7a0 | 2016-11-15 14:05:01 -0500 | [diff] [blame] | 282 | const char* fImageLoadStoreExtensionString; |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 283 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 284 | const char* fFBFetchColorName; |
| 285 | const char* fFBFetchExtensionString; |
| 286 | |
jvanverth | e78d487 | 2016-09-27 03:33:05 -0700 | [diff] [blame] | 287 | int fMaxVertexSamplers; |
| 288 | int fMaxGeometrySamplers; |
| 289 | int fMaxFragmentSamplers; |
| 290 | int fMaxCombinedSamplers; |
cdalton | 9c3f143 | 2016-03-11 10:07:37 -0800 | [diff] [blame] | 291 | |
Brian Salomon | 762d5e7 | 2017-12-01 10:25:08 -0500 | [diff] [blame] | 292 | size_t fDisableImageMultitexturingDstRectAreaThreshold; |
| 293 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 294 | AdvBlendEqInteraction fAdvBlendEqInteraction; |
| 295 | |
bsalomon | cdee009 | 2016-01-08 13:20:12 -0800 | [diff] [blame] | 296 | GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt]; |
bsalomon | 7f9b2e4 | 2016-01-12 13:29:26 -0800 | [diff] [blame] | 297 | GrSwizzle fConfigOutputSwizzle[kGrPixelConfigCnt]; |
egdaniel | b7e7d57 | 2015-11-04 04:23:53 -0800 | [diff] [blame] | 298 | |
Chris Dalton | 040238b | 2017-12-18 14:22:34 -0700 | [diff] [blame] | 299 | friend class GrCaps; // For initialization. |
| 300 | friend class GrGLCaps; |
Chris Dalton | fddb6c0 | 2017-11-04 15:22:22 -0600 | [diff] [blame] | 301 | friend class GrMockCaps; |
Greg Daniel | cebcb84 | 2017-07-31 10:45:52 -0400 | [diff] [blame] | 302 | friend class GrMtlCaps; |
egdaniel | fa89632 | 2016-01-13 12:19:30 -0800 | [diff] [blame] | 303 | friend class GrVkCaps; |
Brian Salomon | f1dd677 | 2016-11-29 15:27:52 -0500 | [diff] [blame] | 304 | friend class SkSL::ShaderCapsFactory; |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 305 | }; |
| 306 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 307 | #endif |