Skip to content

Commit

Permalink
only use highp in mobile browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Jun 12, 2015
1 parent 3b8b9c4 commit 1d03d91
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion js/render/gl_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 1d03d91

Please sign in to comment.