OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef GrShaderVar_DEFINED | 8 #ifndef GrShaderVar_DEFINED |
9 #define GrShaderVar_DEFINED | 9 #define GrShaderVar_DEFINED |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 kIn_TypeModifier, | 28 kIn_TypeModifier, |
29 kInOut_TypeModifier, | 29 kInOut_TypeModifier, |
30 kUniform_TypeModifier, | 30 kUniform_TypeModifier, |
31 // GL Specific types below | 31 // GL Specific types below |
32 kAttribute_TypeModifier, | 32 kAttribute_TypeModifier, |
33 kVaryingIn_TypeModifier, | 33 kVaryingIn_TypeModifier, |
34 kVaryingOut_TypeModifier | 34 kVaryingOut_TypeModifier |
35 }; | 35 }; |
36 | 36 |
37 enum Precision { | 37 enum Precision { |
38 kLow_Precision, // lowp | 38 kLow_Precision, |
39 kMedium_Precision, // mediump | 39 kMedium_Precision, |
40 kHigh_Precision, // highp | 40 kHigh_Precision, |
41 kDefault_Precision, // Default for the current context. We make | 41 |
42 // fragment shaders default to mediump on ES2 | 42 // Default precision is medium. This is because on OpenGL ES 2 highp sup
port is not |
43 // because highp support is not guaranteed (and | 43 // guaranteed. On (non-ES) OpenGL the specifiers have no effect on preci
sion. |
44 // we haven't been motivated to test for it). | 44 kDefault_Precision = kMedium_Precision, |
45 // Otherwise, highp. | |
46 }; | 45 }; |
47 | 46 |
48 /** | 47 /** |
49 * Defaults to a float with no precision specifier | 48 * Defaults to a float with no precision specifier |
50 */ | 49 */ |
51 GrShaderVar() | 50 GrShaderVar() |
52 : fType(kFloat_GrSLType) | 51 : fType(kFloat_GrSLType) |
53 , fTypeModifier(kNone_TypeModifier) | 52 , fTypeModifier(kNone_TypeModifier) |
54 , fCount(kNonArray) | 53 , fCount(kNonArray) |
55 , fPrecision(kDefault_Precision) { | 54 , fPrecision(kDefault_Precision) { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 223 |
225 protected: | 224 protected: |
226 GrSLType fType; | 225 GrSLType fType; |
227 TypeModifier fTypeModifier; | 226 TypeModifier fTypeModifier; |
228 SkString fName; | 227 SkString fName; |
229 int fCount; | 228 int fCount; |
230 Precision fPrecision; | 229 Precision fPrecision; |
231 }; | 230 }; |
232 | 231 |
233 #endif | 232 #endif |
OLD | NEW |