diff options
author | 2016-03-01 12:12:20 -0800 | |
---|---|---|
committer | 2016-03-01 12:12:20 -0800 | |
commit | 4a98cdb7612493a062358cebd1141c9bcaa37ab1 (patch) | |
tree | 7cb8f8efe42f159ead3b9a2b102da1099efa03d7 /src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp | |
parent | b3f3148ac4a3da7fe5aa1428da1f6a17c37e8f4b (diff) |
Add cap and builder feature for multisample interpolation
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1722363002
Review URL: https://codereview.chromium.org/1722363002
Diffstat (limited to 'src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp')
-rw-r--r-- | src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp index bd0108407f..e6717a9e4d 100644 --- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp +++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp @@ -87,25 +87,31 @@ bool GrGLSLFragmentShaderBuilder::hasFragmentPosition() const { } 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; |