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

Unified Diff: src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp

Issue 1722363002: Add cap and builder feature for multisample interpolation (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_samplelocations
Patch Set: simplify 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
« src/gpu/glsl/GrGLSLCaps.cpp ('K') | « src/gpu/glsl/GrGLSLFragmentShaderBuilder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index bd0108407f076d5fce9ee45e2dcba8c80939107a..e6717a9e4d4579d737e68e8d062dd6f08066678b 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;
« src/gpu/glsl/GrGLSLCaps.cpp ('K') | « src/gpu/glsl/GrGLSLFragmentShaderBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698