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 | |
94 GrGLSLGeneration generation() const { return fGLSLGeneration; } | 85 GrGLSLGeneration generation() const { return fGLSLGeneration; } |
95 | 86 |
96 /** | 87 /** |
97 * Returns a string containing the caps info. | 88 * Returns a string containing the caps info. |
98 */ | 89 */ |
99 SkString dump() const override; | 90 SkString dump() const override; |
100 | 91 |
101 private: | 92 private: |
102 void onApplyOptionsOverrides(const GrContextOptions& options) override; | |
103 | |
104 GrGLSLGeneration fGLSLGeneration; | 93 GrGLSLGeneration fGLSLGeneration; |
105 | 94 |
106 bool fDropsTileOnZeroDivide : 1; | 95 bool fDropsTileOnZeroDivide : 1; |
107 bool fFBFetchSupport : 1; | 96 bool fFBFetchSupport : 1; |
108 bool fFBFetchNeedsCustomOutput : 1; | 97 bool fFBFetchNeedsCustomOutput : 1; |
109 bool fBindlessTextureSupport : 1; | 98 bool fBindlessTextureSupport : 1; |
110 bool fUsesPrecisionModifiers : 1; | 99 bool fUsesPrecisionModifiers : 1; |
111 bool fCanUseAnyFunctionInShader : 1; | 100 bool fCanUseAnyFunctionInShader : 1; |
112 bool fForceHighPrecisionNDSTransform : 1; | 101 bool fForceHighPrecisionNDSTransform : 1; |
113 | 102 |
114 const char* fVersionDeclString; | 103 const char* fVersionDeclString; |
115 | 104 |
116 const char* fShaderDerivativeExtensionString; | 105 const char* fShaderDerivativeExtensionString; |
117 | 106 |
118 const char* fFBFetchColorName; | 107 const char* fFBFetchColorName; |
119 const char* fFBFetchExtensionString; | 108 const char* fFBFetchExtensionString; |
120 | 109 |
121 AdvBlendEqInteraction fAdvBlendEqInteraction; | 110 AdvBlendEqInteraction fAdvBlendEqInteraction; |
122 | 111 |
123 bool fMustSwizzleInShader; | |
124 const char* fConfigSwizzle[kGrPixelConfigCnt]; | |
125 | |
126 friend class GrGLCaps; // For initialization. | 112 friend class GrGLCaps; // For initialization. |
127 | 113 |
128 typedef GrShaderCaps INHERITED; | 114 typedef GrShaderCaps INHERITED; |
129 }; | 115 }; |
130 | 116 |
131 | 117 |
132 #endif | 118 #endif |
OLD | NEW |