|
14444 | 14444 | * @author mrdoob / http://mrdoob.com/
|
14445 | 14445 | */
|
14446 | 14446 |
|
14447 |
| - function WebGLAttributes( gl ) { |
| 14447 | + function WebGLAttributes( gl, capabilities ) { |
14448 | 14448 |
|
14449 | 14449 | var buffers = new WeakMap();
|
14450 | 14450 |
|
|
14520 | 14520 |
|
14521 | 14521 | } else {
|
14522 | 14522 |
|
14523 |
| - gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, |
14524 |
| - array.subarray( updateRange.offset, updateRange.offset + updateRange.count ) ); |
| 14523 | + if ( capabilities.isWebGL2 ) { |
| 14524 | + |
| 14525 | + gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, |
| 14526 | + array, updateRange.offset, updateRange.count ); |
| 14527 | + |
| 14528 | + } else { |
| 14529 | + |
| 14530 | + gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, |
| 14531 | + array.subarray( updateRange.offset, updateRange.offset + updateRange.count ) ); |
| 14532 | + |
| 14533 | + } |
14525 | 14534 |
|
14526 | 14535 | updateRange.count = - 1; // reset range
|
14527 | 14536 |
|
|
23640 | 23649 | info = new WebGLInfo( _gl );
|
23641 | 23650 | properties = new WebGLProperties();
|
23642 | 23651 | textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info );
|
23643 |
| - attributes = new WebGLAttributes( _gl ); |
| 23652 | + attributes = new WebGLAttributes( _gl, capabilities ); |
23644 | 23653 | geometries = new WebGLGeometries( _gl, attributes, info );
|
23645 | 23654 | objects = new WebGLObjects( _gl, geometries, attributes, info );
|
23646 | 23655 | morphtargets = new WebGLMorphtargets( _gl );
|
|
0 commit comments