Browse Source

Fixed INVALID_OPERATION error with WebGL when using linewidth on IE11

Ludovic Bailly 8 years ago
parent
commit
9a75363822
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/renderers/webgl/WebGLState.js

+ 3 - 1
src/renderers/webgl/WebGLState.js

@@ -336,6 +336,8 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
 
 
 	var maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS );
 	var maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS );
 
 
+	var lineWidthAvailable = parseFloat(gl.getParameter(gl.VERSION).split(' ')[1]) >= 1.0;
+
 	var currentTextureSlot = null;
 	var currentTextureSlot = null;
 	var currentBoundTextures = {};
 	var currentBoundTextures = {};
 
 
@@ -724,7 +726,7 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
 
 
 	function setLineWidth( width ) {
 	function setLineWidth( width ) {
 
 
-		if ( width !== currentLineWidth ) {
+		if ( lineWidthAvailable && width !== currentLineWidth ) {
 
 
 			gl.lineWidth( width );
 			gl.lineWidth( width );