Browse Source

Merge pull request #20056 from greggman/check-cached-attribute

WebGLBindingStates: check if cachedAttribute is undefined
Mr.doob 5 years ago
parent
commit
0dc43355d7
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/renderers/webgl/WebGLBindingStates.js

+ 2 - 0
src/renderers/webgl/WebGLBindingStates.js

@@ -175,6 +175,8 @@
 			const cachedAttribute = cachedAttributes[ key ];
 			const cachedAttribute = cachedAttributes[ key ];
 			const geometryAttribute = geometryAttributes[ key ];
 			const geometryAttribute = geometryAttributes[ key ];
 
 
+			if ( cachedAttribute === undefined ) return true;
+
 			if ( cachedAttribute.attribute !== geometryAttribute ) return true;
 			if ( cachedAttribute.attribute !== geometryAttribute ) return true;
 
 
 			if ( cachedAttribute.data !== geometryAttribute.data ) return true;
 			if ( cachedAttribute.data !== geometryAttribute.data ) return true;