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 /* | |
bsalomon
2015/11/02 20:44:59
/**
egdaniel
2015/11/02 22:14:11
Done.
| |
87 * Returns a string which represents how the mapping from an internal GrPixe lConfig to a | |
bsalomon
2015/11/02 20:44:59
incomplete sentence?
egdaniel
2015/11/02 22:14:11
Done.
| |
88 * GL Format. A draw side swizzle will then use this mapping to correctly se t components. | |
89 */ | |
90 const char* getSwizzleMap(GrPixelConfig config) const { return fConfigSwizzl e[config]; } | |
91 | |
85 GrGLSLGeneration generation() const { return fGLSLGeneration; } | 92 GrGLSLGeneration generation() const { return fGLSLGeneration; } |
86 | 93 |
87 /** | 94 /** |
88 * Returns a string containing the caps info. | 95 * Returns a string containing the caps info. |
89 */ | 96 */ |
90 SkString dump() const override; | 97 SkString dump() const override; |
91 | 98 |
92 private: | 99 private: |
100 void onApplyOptionsOverrides(const GrContextOptions& options) override; | |
101 | |
93 GrGLSLGeneration fGLSLGeneration; | 102 GrGLSLGeneration fGLSLGeneration; |
94 | 103 |
95 bool fDropsTileOnZeroDivide : 1; | 104 bool fDropsTileOnZeroDivide : 1; |
96 bool fFBFetchSupport : 1; | 105 bool fFBFetchSupport : 1; |
97 bool fFBFetchNeedsCustomOutput : 1; | 106 bool fFBFetchNeedsCustomOutput : 1; |
98 bool fBindlessTextureSupport : 1; | 107 bool fBindlessTextureSupport : 1; |
99 bool fUsesPrecisionModifiers : 1; | 108 bool fUsesPrecisionModifiers : 1; |
100 bool fCanUseAnyFunctionInShader : 1; | 109 bool fCanUseAnyFunctionInShader : 1; |
101 bool fForceHighPrecisionNDSTransform : 1; | 110 bool fForceHighPrecisionNDSTransform : 1; |
102 | 111 |
103 const char* fVersionDeclString; | 112 const char* fVersionDeclString; |
104 | 113 |
105 const char* fShaderDerivativeExtensionString; | 114 const char* fShaderDerivativeExtensionString; |
106 | 115 |
107 const char* fFBFetchColorName; | 116 const char* fFBFetchColorName; |
108 const char* fFBFetchExtensionString; | 117 const char* fFBFetchExtensionString; |
109 | 118 |
110 AdvBlendEqInteraction fAdvBlendEqInteraction; | 119 AdvBlendEqInteraction fAdvBlendEqInteraction; |
111 | 120 |
121 bool fMustSwizzleInShader; | |
122 const char* fConfigSwizzle[kGrPixelConfigCnt]; | |
123 | |
112 friend class GrGLCaps; // For initialization. | 124 friend class GrGLCaps; // For initialization. |
113 | 125 |
114 typedef GrShaderCaps INHERITED; | 126 typedef GrShaderCaps INHERITED; |
115 }; | 127 }; |
116 | 128 |
117 | 129 |
118 #endif | 130 #endif |
OLD | NEW |