Index: src/gpu/glsl/GrGLSLShaderVar.h |
diff --git a/src/gpu/glsl/GrGLSLShaderVar.h b/src/gpu/glsl/GrGLSLShaderVar.h |
index a7d7479d3908c5d3dfdb2703972af12366a389da..9d162ecaa4b5f05f6808bbf9a7be342f32ff0fd1 100644 |
--- a/src/gpu/glsl/GrGLSLShaderVar.h |
+++ b/src/gpu/glsl/GrGLSLShaderVar.h |
@@ -174,8 +174,9 @@ public: |
out->append(" "); |
} |
GrSLType effectiveType = this->getType(); |
- if (GrSLTypeAcceptsPrecision(effectiveType)) { |
- out->append(PrecisionString(glslCaps, fPrecision)); |
+ if (glslCaps->usesPrecisionModifiers() && GrSLTypeAcceptsPrecision(effectiveType)) { |
+ // Desktop GLSL has added precision qualifiers but they don't do anything. |
+ out->appendf("%s ", GrGLSLPrecisionString(fPrecision)); |
} |
if (this->isArray()) { |
if (this->isUnsizedArray()) { |
@@ -210,23 +211,6 @@ public: |
fUseUniformFloatArrays ? "" : ".x"); |
} |
- static const char* PrecisionString(const GrGLSLCaps* glslCaps, GrSLPrecision p) { |
- // Desktop GLSL has added precision qualifiers but they don't do anything. |
- if (glslCaps->usesPrecisionModifiers()) { |
- switch (p) { |
- case kLow_GrSLPrecision: |
- return "lowp "; |
- case kMedium_GrSLPrecision: |
- return "mediump "; |
- case kHigh_GrSLPrecision: |
- return "highp "; |
- default: |
- SkFAIL("Unexpected precision type."); |
- } |
- } |
- return ""; |
- } |
- |
private: |
static const char* TypeModifierString(const GrGLSLCaps* glslCaps, TypeModifier t) { |
GrGLSLGeneration gen = glslCaps->generation(); |