diff --git a/js/render/gl_util.js b/js/render/gl_util.js index a2c58f278fd..207c9a05d89 100644 --- a/js/render/gl_util.js +++ b/js/render/gl_util.js @@ -18,7 +18,14 @@ exports.extend = function(context) { } var shader = this.createShader(type); - this.shaderSource(shader, shaders[name][kind]); + var shaderSource = shaders[name][kind]; + + if (typeof orientation === 'undefined') { + // only use highp precision on mobile browsers + shaderSource = shaderSource.replace(/ highp /g, ' '); + } + + this.shaderSource(shader, shaderSource); this.compileShader(shader); if (!this.getShaderParameter(shader, this.COMPILE_STATUS)) { throw new Error(this.getShaderInfoLog(shader));