Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: include/gpu/GrTypesPriv.h

Issue 777443003: Move shader precision out of GrShaderVar (Closed) Base URL: https://skia.googlesource.com/skia.git@prec
Patch Set: rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrShaderVar.h ('k') | src/gpu/GrCoordTransform.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 GrTypesPriv_DEFINED 8 #ifndef GrTypesPriv_DEFINED
9 #define GrTypesPriv_DEFINED 9 #define GrTypesPriv_DEFINED
10 10
(...skipping 21 matching lines...) Expand all
32 enum GrShaderType { 32 enum GrShaderType {
33 kVertex_GrShaderType, 33 kVertex_GrShaderType,
34 kGeometry_GrShaderType, 34 kGeometry_GrShaderType,
35 kFragment_GrShaderType, 35 kFragment_GrShaderType,
36 36
37 kLastkFragment_GrShaderType = kFragment_GrShaderType 37 kLastkFragment_GrShaderType = kFragment_GrShaderType
38 }; 38 };
39 static const int kGrShaderTypeCount = kLastkFragment_GrShaderType + 1; 39 static const int kGrShaderTypeCount = kLastkFragment_GrShaderType + 1;
40 40
41 /** 41 /**
42 * Precisions of shader language variables. Not all shading languages support pr ecisions or actually
43 * vary the internal precision based on the qualifiers.
44 */
45 enum GrSLPrecision {
46 kLow_GrSLPrecision,
47 kMedium_GrSLPrecision,
48 kHigh_GrSLPrecision,
49
50 // Default precision is medium. This is because on OpenGL ES 2 highp support is not
51 // guaranteed. On (non-ES) OpenGL the specifiers have no effect on precision .
52 kDefault_GrSLPrecision = kMedium_GrSLPrecision,
53
54 kLast_GrSLPrecision = kHigh_GrSLPrecision
55 };
56
57 static const int kGrSLPrecisionCount = kLast_GrSLPrecision + 1;
58
59 /**
42 * Gets the vector size of the SLType. Returns -1 for void, matrices, and sample rs. 60 * Gets the vector size of the SLType. Returns -1 for void, matrices, and sample rs.
43 */ 61 */
44 static inline int GrSLTypeVectorCount(GrSLType type) { 62 static inline int GrSLTypeVectorCount(GrSLType type) {
45 SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount)); 63 SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount));
46 static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1 }; 64 static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1 };
47 return kCounts[type]; 65 return kCounts[type];
48 66
49 GR_STATIC_ASSERT(0 == kVoid_GrSLType); 67 GR_STATIC_ASSERT(0 == kVoid_GrSLType);
50 GR_STATIC_ASSERT(1 == kFloat_GrSLType); 68 GR_STATIC_ASSERT(1 == kFloat_GrSLType);
51 GR_STATIC_ASSERT(2 == kVec2f_GrSLType); 69 GR_STATIC_ASSERT(2 == kVec2f_GrSLType);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 /** 218 /**
201 * Indicates the type of pending IO operations that can be recorded for gpu reso urces. 219 * Indicates the type of pending IO operations that can be recorded for gpu reso urces.
202 */ 220 */
203 enum GrIOType { 221 enum GrIOType {
204 kRead_GrIOType, 222 kRead_GrIOType,
205 kWrite_GrIOType, 223 kWrite_GrIOType,
206 kRW_GrIOType 224 kRW_GrIOType
207 }; 225 };
208 226
209 #endif 227 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrShaderVar.h ('k') | src/gpu/GrCoordTransform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698