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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 bool forceHighPrecisionNDSTransform() const { return fForceHighPrecisionNDST
ransform; } | 75 bool forceHighPrecisionNDSTransform() const { return fForceHighPrecisionNDST
ransform; } |
76 | 76 |
77 // Returns the string of an extension that must be enabled in the shader to
support | 77 // 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 | 78 // 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. | 79 // this function, the caller should check that shaderDerivativeSupport exist
s. |
80 const char* shaderDerivativeExtensionString() const { | 80 const char* shaderDerivativeExtensionString() const { |
81 SkASSERT(this->shaderDerivativeSupport()); | 81 SkASSERT(this->shaderDerivativeSupport()); |
82 return fShaderDerivativeExtensionString; | 82 return fShaderDerivativeExtensionString; |
83 } | 83 } |
84 | 84 |
| 85 bool mustSwizzleInShader() const { return fMustSwizzleInShader; } |
| 86 |
| 87 /** |
| 88 * 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 |
| 90 * in the generated shader code or using sample state in the 3D API. |
| 91 */ |
| 92 const char* getSwizzleMap(GrPixelConfig config) const { return fConfigSwizzl
e[config]; } |
| 93 |
85 GrGLSLGeneration generation() const { return fGLSLGeneration; } | 94 GrGLSLGeneration generation() const { return fGLSLGeneration; } |
86 | 95 |
87 /** | 96 /** |
88 * Returns a string containing the caps info. | 97 * Returns a string containing the caps info. |
89 */ | 98 */ |
90 SkString dump() const override; | 99 SkString dump() const override; |
91 | 100 |
92 private: | 101 private: |
| 102 void onApplyOptionsOverrides(const GrContextOptions& options) override; |
| 103 |
93 GrGLSLGeneration fGLSLGeneration; | 104 GrGLSLGeneration fGLSLGeneration; |
94 | 105 |
95 bool fDropsTileOnZeroDivide : 1; | 106 bool fDropsTileOnZeroDivide : 1; |
96 bool fFBFetchSupport : 1; | 107 bool fFBFetchSupport : 1; |
97 bool fFBFetchNeedsCustomOutput : 1; | 108 bool fFBFetchNeedsCustomOutput : 1; |
98 bool fBindlessTextureSupport : 1; | 109 bool fBindlessTextureSupport : 1; |
99 bool fUsesPrecisionModifiers : 1; | 110 bool fUsesPrecisionModifiers : 1; |
100 bool fCanUseAnyFunctionInShader : 1; | 111 bool fCanUseAnyFunctionInShader : 1; |
101 bool fForceHighPrecisionNDSTransform : 1; | 112 bool fForceHighPrecisionNDSTransform : 1; |
102 | 113 |
103 const char* fVersionDeclString; | 114 const char* fVersionDeclString; |
104 | 115 |
105 const char* fShaderDerivativeExtensionString; | 116 const char* fShaderDerivativeExtensionString; |
106 | 117 |
107 const char* fFBFetchColorName; | 118 const char* fFBFetchColorName; |
108 const char* fFBFetchExtensionString; | 119 const char* fFBFetchExtensionString; |
109 | 120 |
110 AdvBlendEqInteraction fAdvBlendEqInteraction; | 121 AdvBlendEqInteraction fAdvBlendEqInteraction; |
111 | 122 |
| 123 bool fMustSwizzleInShader; |
| 124 const char* fConfigSwizzle[kGrPixelConfigCnt]; |
| 125 |
112 friend class GrGLCaps; // For initialization. | 126 friend class GrGLCaps; // For initialization. |
113 | 127 |
114 typedef GrShaderCaps INHERITED; | 128 typedef GrShaderCaps INHERITED; |
115 }; | 129 }; |
116 | 130 |
117 | 131 |
118 #endif | 132 #endif |
OLD | NEW |