}
if (kGL_GrGLStandard == standard) {
+ glslCaps->fMultisampleInterpolationSupport =
+ ctxInfo.glslGeneration() >= k400_GrGLSLGeneration;
+ } else {
+ if (ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration) {
+ glslCaps->fMultisampleInterpolationSupport = true;
+ } else if (ctxInfo.hasExtension("GL_OES_shader_multisample_interpolation")) {
+ glslCaps->fMultisampleInterpolationSupport = true;
+ glslCaps->fMultisampleInterpolationExtensionString =
+ "GL_OES_shader_multisample_interpolation";
+ }
+ }
+
+ if (kGL_GrGLStandard == standard) {
glslCaps->fSampleVariablesSupport = ctxInfo.glslGeneration() >= k400_GrGLSLGeneration;
} else {
if (ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration) {
fMustForceNegatedAtanParamToFloat = false;
fFlatInterpolationSupport = false;
fNoPerspectiveInterpolationSupport = false;
+ fMultisampleInterpolationSupport = false;
fSampleVariablesSupport = false;
fSampleMaskOverrideCoverageSupport = false;
fVersionDeclString = nullptr;
fSecondaryOutputExtensionString = nullptr;
fExternalTextureExtensionString = nullptr;
fNoPerspectiveInterpolationExtensionString = nullptr;
+ fMultisampleInterpolationExtensionString = nullptr;
fSampleVariablesExtensionString = nullptr;
fFBFetchColorName = nullptr;
fFBFetchExtensionString = nullptr;
r.appendf("Flat interpolation support: %s\n", (fFlatInterpolationSupport ? "YES" : "NO"));
r.appendf("No perspective interpolation support: %s\n", (fNoPerspectiveInterpolationSupport ?
"YES" : "NO"));
+ r.appendf("Multisample interpolation support: %s\n", (fMultisampleInterpolationSupport ?
+ "YES" : "NO"));
r.appendf("Sample variables support: %s\n", (fSampleVariablesSupport ? "YES" : "NO"));
r.appendf("Sample mask override coverage support: %s\n", (fSampleMaskOverrideCoverageSupport ?
"YES" : "NO"));
bool noperspectiveInterpolationSupport() const { return fNoPerspectiveInterpolationSupport; }
+ bool multisampleInterpolationSupport() const { return fMultisampleInterpolationSupport; }
+
bool sampleVariablesSupport() const { return fSampleVariablesSupport; }
bool sampleMaskOverrideCoverageSupport() const { return fSampleMaskOverrideCoverageSupport; }
return fNoPerspectiveInterpolationExtensionString;
}
+ const char* multisampleInterpolationExtensionString() const {
+ SkASSERT(this->multisampleInterpolationSupport());
+ return fMultisampleInterpolationExtensionString;
+ }
+
const char* sampleVariablesExtensionString() const {
SkASSERT(this->sampleVariablesSupport());
return fSampleVariablesExtensionString;
bool fCanUseAnyFunctionInShader : 1;
bool fFlatInterpolationSupport : 1;
bool fNoPerspectiveInterpolationSupport : 1;
+ bool fMultisampleInterpolationSupport : 1;
bool fSampleVariablesSupport : 1;
bool fSampleMaskOverrideCoverageSupport : 1;
const char* fSecondaryOutputExtensionString;
const char* fExternalTextureExtensionString;
const char* fNoPerspectiveInterpolationExtensionString;
+ const char* fMultisampleInterpolationExtensionString;
const char* fSampleVariablesExtensionString;
const char* fFBFetchColorName;
}
bool GrGLSLFragmentShaderBuilder::enableFeature(GLSLFeature feature) {
+ const GrGLSLCaps& glslCaps = *fProgramBuilder->glslCaps();
switch (feature) {
- case kStandardDerivatives_GLSLFeature: {
- if (!fProgramBuilder->glslCaps()->shaderDerivativeSupport()) {
+ case kStandardDerivatives_GLSLFeature:
+ if (!glslCaps.shaderDerivativeSupport()) {
return false;
}
- const char* extension = fProgramBuilder->glslCaps()->shaderDerivativeExtensionString();
- if (extension) {
+ if (const char* extension = glslCaps.shaderDerivativeExtensionString()) {
this->addFeature(1 << kStandardDerivatives_GLSLFeature, extension);
}
return true;
- }
- case kPixelLocalStorage_GLSLFeature: {
- if (fProgramBuilder->glslCaps()->pixelLocalStorageSize() <= 0) {
+ case kPixelLocalStorage_GLSLFeature:
+ if (glslCaps.pixelLocalStorageSize() <= 0) {
return false;
}
this->addFeature(1 << kPixelLocalStorage_GLSLFeature,
"GL_EXT_shader_pixel_local_storage");
return true;
- }
+ case kMultisampleInterpolation_GLSLFeature:
+ if (!glslCaps.multisampleInterpolationSupport()) {
+ return false;
+ }
+ if (const char* extension = glslCaps.multisampleInterpolationExtensionString()) {
+ this->addFeature(1 << kMultisampleInterpolation_GLSLFeature, extension);
+ }
+ return true;
default:
SkFAIL("Unexpected GLSLFeature requested.");
return false;
*/
enum GLSLFeature {
kStandardDerivatives_GLSLFeature = kLastGLSLPrivateFeature + 1,
- kPixelLocalStorage_GLSLFeature
+ kPixelLocalStorage_GLSLFeature,
+ kMultisampleInterpolation_GLSLFeature
};
/**