| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 return fGLSLGeneration > k110_GrGLSLGeneration; | 67 return fGLSLGeneration > k110_GrGLSLGeneration; |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool usesPrecisionModifiers() const { return fUsesPrecisionModifiers; } | 70 bool usesPrecisionModifiers() const { return fUsesPrecisionModifiers; } |
| 71 | 71 |
| 72 // Returns whether we can use the glsl funciton any() in our shader code. | 72 // Returns whether we can use the glsl funciton any() in our shader code. |
| 73 bool canUseAnyFunctionInShader() const { return fCanUseAnyFunctionInShader;
} | 73 bool canUseAnyFunctionInShader() const { return fCanUseAnyFunctionInShader;
} |
| 74 | 74 |
| 75 bool forceHighPrecisionNDSTransform() const { return fForceHighPrecisionNDST
ransform; } | 75 bool forceHighPrecisionNDSTransform() const { return fForceHighPrecisionNDST
ransform; } |
| 76 | 76 |
| 77 bool canUseMinAndAbsTogether() const { return fCanUseMinAndAbsTogether; } |
| 78 |
| 79 bool mustForceNegatedAtanParamToFloat() const { return fMustForceNegatedAtan
ParamToFloat; } |
| 80 |
| 77 // Returns the string of an extension that must be enabled in the shader to
support | 81 // Returns the string of an extension that must be enabled in the shader to
support |
| 78 // derivatives. If nullptr is returned then no extension needs to be enabled
. Before calling | 82 // derivatives. If nullptr is returned then no extension needs to be enabled
. Before calling |
| 79 // this function, the caller should check that shaderDerivativeSupport exist
s. | 83 // this function, the caller should check that shaderDerivativeSupport exist
s. |
| 80 const char* shaderDerivativeExtensionString() const { | 84 const char* shaderDerivativeExtensionString() const { |
| 81 SkASSERT(this->shaderDerivativeSupport()); | 85 SkASSERT(this->shaderDerivativeSupport()); |
| 82 return fShaderDerivativeExtensionString; | 86 return fShaderDerivativeExtensionString; |
| 83 } | 87 } |
| 88 |
| 89 // Returns the string of an extension that will do all necessary coord trans
fomations needed |
| 90 // when reading the fragment position. If such an extension does not exisits
, this function |
| 91 // returns a nullptr, and all transforms of the frag position must be done m
anually in the |
| 92 // shader. |
| 93 const char* fragCoordConventionsExtensionString() const { |
| 94 return fFragCoordConventionsExtensionString; |
| 95 } |
| 96 |
| 97 // This returns the name of an extension that must be enabled in the shader,
if such a thing is |
| 98 // required in order to use a secondary output in the shader. This returns a
nullptr if no such |
| 99 // extension is required. However, the return value of this function does no
t say whether dual |
| 100 // source blending is supported. |
| 101 const char* secondaryOutputExtensionString() const { |
| 102 return fSecondaryOutputExtensionString; |
| 103 } |
| 84 | 104 |
| 85 bool mustSwizzleInShader() const { return fMustSwizzleInShader; } | 105 bool mustSwizzleInShader() const { return fMustSwizzleInShader; } |
| 86 | 106 |
| 87 /** | 107 /** |
| 88 * Returns a string which represents how to map from an internal GLFormat to
a given | 108 * Returns a string which represents how to map from an internal GLFormat to
a given |
| 89 * GrPixelConfig. The function mustSwizzleInShader determines whether this s
wizzle is applied | 109 * GrPixelConfig. The function mustSwizzleInShader determines whether this s
wizzle is applied |
| 90 * in the generated shader code or using sample state in the 3D API. | 110 * in the generated shader code or using sample state in the 3D API. |
| 91 */ | 111 */ |
| 92 const char* getSwizzleMap(GrPixelConfig config) const { return fConfigSwizzl
e[config]; } | 112 const char* getSwizzleMap(GrPixelConfig config) const { return fConfigSwizzl
e[config]; } |
| 93 | 113 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 104 GrGLSLGeneration fGLSLGeneration; | 124 GrGLSLGeneration fGLSLGeneration; |
| 105 | 125 |
| 106 bool fDropsTileOnZeroDivide : 1; | 126 bool fDropsTileOnZeroDivide : 1; |
| 107 bool fFBFetchSupport : 1; | 127 bool fFBFetchSupport : 1; |
| 108 bool fFBFetchNeedsCustomOutput : 1; | 128 bool fFBFetchNeedsCustomOutput : 1; |
| 109 bool fBindlessTextureSupport : 1; | 129 bool fBindlessTextureSupport : 1; |
| 110 bool fUsesPrecisionModifiers : 1; | 130 bool fUsesPrecisionModifiers : 1; |
| 111 bool fCanUseAnyFunctionInShader : 1; | 131 bool fCanUseAnyFunctionInShader : 1; |
| 112 bool fForceHighPrecisionNDSTransform : 1; | 132 bool fForceHighPrecisionNDSTransform : 1; |
| 113 | 133 |
| 134 // Used for specific driver bug work arounds |
| 135 bool fCanUseMinAndAbsTogether : 1; |
| 136 bool fMustForceNegatedAtanParamToFloat : 1; |
| 137 |
| 114 const char* fVersionDeclString; | 138 const char* fVersionDeclString; |
| 115 | 139 |
| 116 const char* fShaderDerivativeExtensionString; | 140 const char* fShaderDerivativeExtensionString; |
| 141 const char* fFragCoordConventionsExtensionString; |
| 142 const char* fSecondaryOutputExtensionString; |
| 117 | 143 |
| 118 const char* fFBFetchColorName; | 144 const char* fFBFetchColorName; |
| 119 const char* fFBFetchExtensionString; | 145 const char* fFBFetchExtensionString; |
| 120 | 146 |
| 121 AdvBlendEqInteraction fAdvBlendEqInteraction; | 147 AdvBlendEqInteraction fAdvBlendEqInteraction; |
| 122 | 148 |
| 123 bool fMustSwizzleInShader; | 149 bool fMustSwizzleInShader; |
| 124 const char* fConfigSwizzle[kGrPixelConfigCnt]; | 150 const char* fConfigSwizzle[kGrPixelConfigCnt]; |
| 125 | 151 |
| 126 friend class GrGLCaps; // For initialization. | 152 friend class GrGLCaps; // For initialization. |
| 127 | 153 |
| 128 typedef GrShaderCaps INHERITED; | 154 typedef GrShaderCaps INHERITED; |
| 129 }; | 155 }; |
| 130 | 156 |
| 131 | 157 |
| 132 #endif | 158 #endif |
| OLD | NEW |