aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLCaps.cpp
diff options
context:
space:
mode:
authorGravatar cdalton <cdalton@nvidia.com>2016-02-22 07:55:44 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-22 07:55:44 -0800
commit33ad701bc30387127c427fb1e38c781d5de33491 (patch)
tree09ab0b0a1c0ce1475f1c5a6c0ea6c35cb944e21f /src/gpu/gl/GrGLCaps.cpp
parent23e7af0e8ab8377b28e1399b4950def672284724 (diff)
Add gl_SampleMask functionality to fragment builders
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index f23a5b80bc..546b0bf692 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -564,9 +564,19 @@ const char* get_glsl_version_decl_string(GrGLStandard standard, GrGLSLGeneration
return "#version 330 compatibility\n";
}
}
+ case k400_GrGLSLGeneration:
+ SkASSERT(kGL_GrGLStandard == standard);
+ if (isCoreProfile) {
+ return "#version 400\n";
+ } else {
+ return "#version 400 compatibility\n";
+ }
case k310es_GrGLSLGeneration:
SkASSERT(kGLES_GrGLStandard == standard);
return "#version 310 es\n";
+ case k320es_GrGLSLGeneration:
+ SkASSERT(kGLES_GrGLStandard == standard);
+ return "#version 320 es\n";
}
return "<no version>";
}
@@ -625,6 +635,22 @@ void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) {
}
}
+ if (kGL_GrGLStandard == standard) {
+ glslCaps->fSampleVariablesSupport = ctxInfo.glslGeneration() >= k400_GrGLSLGeneration;
+ } else {
+ if (ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration) {
+ glslCaps->fSampleVariablesSupport = true;
+ } else if (ctxInfo.hasExtension("GL_OES_sample_variables")) {
+ glslCaps->fSampleVariablesSupport = true;
+ glslCaps->fSampleVariablesExtensionString = "GL_OES_sample_variables";
+ }
+ }
+
+ if (glslCaps->fSampleVariablesSupport) {
+ glslCaps->fSampleMaskOverrideCoverageSupport =
+ ctxInfo.hasExtension("GL_NV_sample_mask_override_coverage");
+ }
+
// Adreno GPUs have a tendency to drop tiles when there is a divide-by-zero in a shader
glslCaps->fDropsTileOnZeroDivide = kQualcomm_GrGLVendor == ctxInfo.vendor();