aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
diff options
context:
space:
mode:
authorGravatar cdalton <cdalton@nvidia.com>2016-03-01 12:12:20 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-01 12:12:20 -0800
commit4a98cdb7612493a062358cebd1141c9bcaa37ab1 (patch)
tree7cb8f8efe42f159ead3b9a2b102da1099efa03d7 /src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
parentb3f3148ac4a3da7fe5aa1428da1f6a17c37e8f4b (diff)
Add cap and builder feature for multisample interpolation
Diffstat (limited to 'src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp')
-rw-r--r--src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp22
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;