瀏覽代碼

Fixed INVALID_OPERATION error with WebGL when using linewidth on IE11

Ludovic Bailly 9 年之前
父節點
當前提交
9a75363822
共有 1 個文件被更改,包括 3 次插入1 次删除
  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 lineWidthAvailable = parseFloat(gl.getParameter(gl.VERSION).split(' ')[1]) >= 1.0;
+
 	var currentTextureSlot = null;
 	var currentBoundTextures = {};
 
@@ -724,7 +726,7 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
 
 	function setLineWidth( width ) {
 
-		if ( width !== currentLineWidth ) {
+		if ( lineWidthAvailable && width !== currentLineWidth ) {
 
 			gl.lineWidth( width );