aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2015-10-22 06:54:15 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-22 06:54:15 -0700
commitcef4bce8e260b49bf3417eadbac806cf7d39cdc8 (patch)
tree999aa307631b82648e3511ddd78a2e36d831e087 /src/gpu/glsl
parenta352b14c8796c0d01ea8581c157a52c7d00973f5 (diff)
Add version string and force highp NDS transfrom to GLSLCaps
This also include the use of any() in the shaders. BUG=skia: Review URL: https://codereview.chromium.org/1417993004
Diffstat (limited to 'src/gpu/glsl')
-rwxr-xr-xsrc/gpu/glsl/GrGLSLCaps.cpp6
-rwxr-xr-xsrc/gpu/glsl/GrGLSLCaps.h10
2 files changed, 16 insertions, 0 deletions
diff --git a/src/gpu/glsl/GrGLSLCaps.cpp b/src/gpu/glsl/GrGLSLCaps.cpp
index 449ceabd76..fef5ab377c 100755
--- a/src/gpu/glsl/GrGLSLCaps.cpp
+++ b/src/gpu/glsl/GrGLSLCaps.cpp
@@ -18,6 +18,9 @@ GrGLSLCaps::GrGLSLCaps(const GrContextOptions& options) {
fFBFetchNeedsCustomOutput = false;
fBindlessTextureSupport = false;
fUsesPrecisionModifiers = false;
+ fCanUseAnyFunctionInShader = true;
+ fForceHighPrecisionNDSTransform = false;
+ fVersionDeclString = nullptr;
fFBFetchColorName = nullptr;
fFBFetchExtensionString = nullptr;
fAdvBlendEqInteraction = kNotSupported_AdvBlendEqInteraction;
@@ -44,6 +47,9 @@ SkString GrGLSLCaps::dump() const {
r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO"));
r.appendf("Bindless texture support: %s\n", (fBindlessTextureSupport ? "YES" : "NO"));
r.appendf("Uses precision modifiers: %s\n", (fUsesPrecisionModifiers ? "YES" : "NO"));
+ r.appendf("Can Use any() function: %s\n", (fCanUseAnyFunctionInShader ? "YES" : "NO"));
+ r.appendf("Force high precision on NDS transform: %s\n", (fForceHighPrecisionNDSTransform ?
+ "YES" : "NO"));
r.appendf("Advanced blend equation interaction: %s\n",
kAdvBlendEqInteractionStr[fAdvBlendEqInteraction]);
return r;
diff --git a/src/gpu/glsl/GrGLSLCaps.h b/src/gpu/glsl/GrGLSLCaps.h
index d147aac3c1..4d6f580667 100755
--- a/src/gpu/glsl/GrGLSLCaps.h
+++ b/src/gpu/glsl/GrGLSLCaps.h
@@ -45,6 +45,8 @@ public:
bool bindlessTextureSupport() const { return fBindlessTextureSupport; }
+ const char* versionDeclString() const { return fVersionDeclString; }
+
const char* fbFetchColorName() const { return fFBFetchColorName; }
const char* fbFetchExtensionString() const { return fFBFetchExtensionString; }
@@ -67,6 +69,11 @@ public:
bool usesPrecisionModifiers() const { return fUsesPrecisionModifiers; }
+ // Returns whether we can use the glsl funciton any() in our shader code.
+ bool canUseAnyFunctionInShader() const { return fCanUseAnyFunctionInShader; }
+
+ bool forceHighPrecisionNDSTransform() const { return fForceHighPrecisionNDSTransform; }
+
GrGLSLGeneration generation() const { return fGLSLGeneration; }
/**
@@ -82,7 +89,10 @@ private:
bool fFBFetchNeedsCustomOutput : 1;
bool fBindlessTextureSupport : 1;
bool fUsesPrecisionModifiers : 1;
+ bool fCanUseAnyFunctionInShader : 1;
+ bool fForceHighPrecisionNDSTransform : 1;
+ const char* fVersionDeclString;
const char* fFBFetchColorName;
const char* fFBFetchExtensionString;