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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrShaderVar.h ('k') | src/gpu/GrCoordTransform.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTypesPriv.h
diff --git a/include/gpu/GrTypesPriv.h b/include/gpu/GrTypesPriv.h
index 83d85612b91b94133700e83b6ffd6b80f1643259..2a8d4c3255ae0642653c302773e5d0b49d9b9247 100644
--- a/include/gpu/GrTypesPriv.h
+++ b/include/gpu/GrTypesPriv.h
@@ -39,6 +39,24 @@ enum GrShaderType {
static const int kGrShaderTypeCount = kLastkFragment_GrShaderType + 1;
/**
+ * Precisions of shader language variables. Not all shading languages support precisions or actually
+ * vary the internal precision based on the qualifiers.
+ */
+enum GrSLPrecision {
+ kLow_GrSLPrecision,
+ kMedium_GrSLPrecision,
+ kHigh_GrSLPrecision,
+
+ // Default precision is medium. This is because on OpenGL ES 2 highp support is not
+ // guaranteed. On (non-ES) OpenGL the specifiers have no effect on precision.
+ kDefault_GrSLPrecision = kMedium_GrSLPrecision,
+
+ kLast_GrSLPrecision = kHigh_GrSLPrecision
+};
+
+static const int kGrSLPrecisionCount = kLast_GrSLPrecision + 1;
+
+/**
* Gets the vector size of the SLType. Returns -1 for void, matrices, and samplers.
*/
static inline int GrSLTypeVectorCount(GrSLType type) {
« 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