aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl/GrGLSLShaderVar.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/glsl/GrGLSLShaderVar.h')
-rw-r--r--src/gpu/glsl/GrGLSLShaderVar.h22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/gpu/glsl/GrGLSLShaderVar.h b/src/gpu/glsl/GrGLSLShaderVar.h
index a7d7479d39..9d162ecaa4 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();