aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLSL.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-06-04 08:49:34 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-04 08:49:34 -0700
commitbc50e5ce6c039f02dc805361ae5b0b66f40b4820 (patch)
tree45c0fb7f35be4021fd3504c557daff91c941e1fa /src/gpu/gl/GrGLSL.cpp
parent8804f589167a3e340d25ee1226aa71eb8a2ae930 (diff)
Disable dual source blending support when GLSL version is too old
Diffstat (limited to 'src/gpu/gl/GrGLSL.cpp')
-rw-r--r--src/gpu/gl/GrGLSL.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLSL.cpp b/src/gpu/gl/GrGLSL.cpp
index f4caf52012..20e6e20938 100644
--- a/src/gpu/gl/GrGLSL.cpp
+++ b/src/gpu/gl/GrGLSL.cpp
@@ -85,10 +85,22 @@ const char* GrGetGLSLVersionDecl(const GrGLContextInfo& info) {
case k310es_GrGLSLGeneration:
SkASSERT(kGLES_GrGLStandard == info.standard());
return "#version 310 es\n";
- default:
- SkFAIL("Unknown GL version.");
- return ""; // suppress warning
}
+ return "<no version>";
+}
+
+bool GrGLSLSupportsNamedFragmentShaderOutputs(GrGLSLGeneration gen) {
+ switch (gen) {
+ case k110_GrGLSLGeneration:
+ return false;
+ case k130_GrGLSLGeneration:
+ case k140_GrGLSLGeneration:
+ case k150_GrGLSLGeneration:
+ case k330_GrGLSLGeneration:
+ case k310es_GrGLSLGeneration:
+ return true;
+ }
+ return false;
}
void GrGLSLAppendDefaultFloatPrecisionDeclaration(GrSLPrecision p, GrGLStandard s, SkString* out) {