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

Unified Diff: src/gpu/gl/GrGLCaps.cpp

Issue 1690963003: Add gl_SampleMask functionality to fragment builders (Closed) Base URL: https://skia.googlesource.com/skia.git@upload7_interp
Patch Set: fix 320 es issue 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 | « no previous file | src/gpu/gl/GrGLGLSL.cpp » ('j') | src/gpu/gl/GrGLGLSL.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index f23a5b80bc62aca605c4590cd67a04a24e8acad3..d20d7a12b7011cbcd231ed315e7e4eb734b96440 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>";
}
@@ -608,6 +618,22 @@ void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) {
glslCaps->fBindlessTextureSupport = ctxInfo.hasExtension("GL_NV_bindless_texture");
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");
+ }
+
+ if (kGL_GrGLStandard == standard) {
glslCaps->fFlatInterpolationSupport = ctxInfo.glslGeneration() >= k130_GrGLSLGeneration;
} else {
glslCaps->fFlatInterpolationSupport =
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGLSL.cpp » ('j') | src/gpu/gl/GrGLGLSL.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698