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 27 matching lines...) Expand all Loading... |
38 * Some helper functions for encapsulating various extensions to read FB Buf
fer on openglES | 38 * Some helper functions for encapsulating various extensions to read FB Buf
fer on openglES |
39 * | 39 * |
40 * TODO(joshualitt) On desktop opengl 4.2+ we can achieve something similar
to this effect | 40 * TODO(joshualitt) On desktop opengl 4.2+ we can achieve something similar
to this effect |
41 */ | 41 */ |
42 bool fbFetchSupport() const { return fFBFetchSupport; } | 42 bool fbFetchSupport() const { return fFBFetchSupport; } |
43 | 43 |
44 bool fbFetchNeedsCustomOutput() const { return fFBFetchNeedsCustomOutput; } | 44 bool fbFetchNeedsCustomOutput() const { return fFBFetchNeedsCustomOutput; } |
45 | 45 |
46 bool bindlessTextureSupport() const { return fBindlessTextureSupport; } | 46 bool bindlessTextureSupport() const { return fBindlessTextureSupport; } |
47 | 47 |
| 48 const char* versionDeclString() const { return fVersionDeclString; } |
| 49 |
48 const char* fbFetchColorName() const { return fFBFetchColorName; } | 50 const char* fbFetchColorName() const { return fFBFetchColorName; } |
49 | 51 |
50 const char* fbFetchExtensionString() const { return fFBFetchExtensionString;
} | 52 const char* fbFetchExtensionString() const { return fFBFetchExtensionString;
} |
51 | 53 |
52 bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } | 54 bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } |
53 | 55 |
54 AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInte
raction; } | 56 AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInte
raction; } |
55 | 57 |
56 bool mustEnableAdvBlendEqs() const { | 58 bool mustEnableAdvBlendEqs() const { |
57 return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction; | 59 return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction; |
58 } | 60 } |
59 | 61 |
60 bool mustEnableSpecificAdvBlendEqs() const { | 62 bool mustEnableSpecificAdvBlendEqs() const { |
61 return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction; | 63 return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction; |
62 } | 64 } |
63 | 65 |
64 bool mustDeclareFragmentShaderOutput() const { | 66 bool mustDeclareFragmentShaderOutput() const { |
65 return fGLSLGeneration > k110_GrGLSLGeneration; | 67 return fGLSLGeneration > k110_GrGLSLGeneration; |
66 } | 68 } |
67 | 69 |
68 bool usesPrecisionModifiers() const { return fUsesPrecisionModifiers; } | 70 bool usesPrecisionModifiers() const { return fUsesPrecisionModifiers; } |
69 | 71 |
| 72 // Returns whether we can use the glsl funciton any() in our shader code. |
| 73 bool canUseAnyFunctionInShader() const { return fCanUseAnyFunctionInShader;
} |
| 74 |
| 75 bool forceHighPrecisionNDSTransform() const { return fForceHighPrecisionNDST
ransform; } |
| 76 |
70 GrGLSLGeneration generation() const { return fGLSLGeneration; } | 77 GrGLSLGeneration generation() const { return fGLSLGeneration; } |
71 | 78 |
72 /** | 79 /** |
73 * Returns a string containing the caps info. | 80 * Returns a string containing the caps info. |
74 */ | 81 */ |
75 SkString dump() const override; | 82 SkString dump() const override; |
76 | 83 |
77 private: | 84 private: |
78 GrGLSLGeneration fGLSLGeneration; | 85 GrGLSLGeneration fGLSLGeneration; |
79 | 86 |
80 bool fDropsTileOnZeroDivide : 1; | 87 bool fDropsTileOnZeroDivide : 1; |
81 bool fFBFetchSupport : 1; | 88 bool fFBFetchSupport : 1; |
82 bool fFBFetchNeedsCustomOutput : 1; | 89 bool fFBFetchNeedsCustomOutput : 1; |
83 bool fBindlessTextureSupport : 1; | 90 bool fBindlessTextureSupport : 1; |
84 bool fUsesPrecisionModifiers : 1; | 91 bool fUsesPrecisionModifiers : 1; |
| 92 bool fCanUseAnyFunctionInShader : 1; |
| 93 bool fForceHighPrecisionNDSTransform : 1; |
85 | 94 |
| 95 const char* fVersionDeclString; |
86 | 96 |
87 const char* fFBFetchColorName; | 97 const char* fFBFetchColorName; |
88 const char* fFBFetchExtensionString; | 98 const char* fFBFetchExtensionString; |
89 | 99 |
90 AdvBlendEqInteraction fAdvBlendEqInteraction; | 100 AdvBlendEqInteraction fAdvBlendEqInteraction; |
91 | 101 |
92 friend class GrGLCaps; // For initialization. | 102 friend class GrGLCaps; // For initialization. |
93 | 103 |
94 typedef GrShaderCaps INHERITED; | 104 typedef GrShaderCaps INHERITED; |
95 }; | 105 }; |
96 | 106 |
97 | 107 |
98 #endif | 108 #endif |
OLD | NEW |