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

Unified Diff: src/gpu/glsl/GrGLSL.h

Issue 1690963003: Add gl_SampleMask functionality to fragment builders (Closed) Base URL: https://skia.googlesource.com/skia.git@upload7_interp
Patch Set: Created 4 years, 10 months 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 | « src/gpu/gl/GrGLGLSL.cpp ('k') | src/gpu/glsl/GrGLSL.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSL.h
diff --git a/src/gpu/glsl/GrGLSL.h b/src/gpu/glsl/GrGLSL.h
index 6fc8f83c7a3ca1be80fada8a9ef72a12d923ca02..1fe23107d88cc283f3747e50c2f17b2a6414707e 100644
--- a/src/gpu/glsl/GrGLSL.h
+++ b/src/gpu/glsl/GrGLSL.h
@@ -37,9 +37,17 @@ enum GrGLSLGeneration {
*/
k330_GrGLSLGeneration,
/**
+ * Desktop GLSL 4.00
+ */
+ k400_GrGLSLGeneration,
+ /**
* ES GLSL 3.10 only TODO Make GLSLCap objects to make this more granular
*/
k310es_GrGLSLGeneration,
+ /**
+ * ES GLSL 3.20
+ */
+ k320es_GrGLSLGeneration,
};
bool GrGLSLSupportsNamedFragmentShaderOutputs(GrGLSLGeneration);
@@ -112,6 +120,20 @@ static inline const char* GrGLSLTypeString(GrSLType t) {
}
}
+/**
+ * Returns the minimum precision that can fully represent an int with the provided number of bits.
+ */
+static inline GrSLPrecision GrGLSLIntMinPrecisionForNBits(int bits) {
bsalomon 2016/02/12 20:58:17 If we're not using this can we remove it?
Chris Dalton 2016/02/12 21:01:50 Oops. Done.
+ SkASSERT(bits <= 32);
+ if (bits <= 9) { // Lowp integers are spec'd to have at least 9 bits.
+ return kLow_GrSLPrecision;
+ } else if (bits <= 16) {
+ return kMedium_GrSLPrecision;
+ } else {
+ return kHigh_GrSLPrecision;
+ }
+}
+
/** A generic base-class representing a GLSL expression.
* The instance can be a variable name, expression or vecN(0) or vecN(1). Does simple constant
* folding with help of 1 and 0.
« no previous file with comments | « src/gpu/gl/GrGLGLSL.cpp ('k') | src/gpu/glsl/GrGLSL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698