aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp')
-rw-r--r--src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index db420c8439..eb744a9915 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -96,6 +96,14 @@ GrGLSLFragmentShaderBuilder::GrGLSLFragmentShaderBuilder(GrGLSLProgramBuilder* p
bool GrGLSLFragmentShaderBuilder::enableFeature(GLSLFeature feature) {
const GrGLSLCaps& glslCaps = *fProgramBuilder->glslCaps();
switch (feature) {
+ case kStandardDerivatives_GLSLFeature:
+ if (!glslCaps.shaderDerivativeSupport()) {
+ return false;
+ }
+ if (const char* extension = glslCaps.shaderDerivativeExtensionString()) {
+ this->addFeature(1 << kStandardDerivatives_GLSLFeature, extension);
+ }
+ return true;
case kPixelLocalStorage_GLSLFeature:
if (glslCaps.pixelLocalStorageSize() <= 0) {
return false;