|
@@ -2,7 +2,7 @@
|
|
|
* @author mrdoob / http://mrdoob.com/
|
|
|
*/
|
|
|
|
|
|
-function WebGLAttributes( gl ) {
|
|
|
+function WebGLAttributes( gl, capabilities ) {
|
|
|
|
|
|
var buffers = new WeakMap();
|
|
|
|
|
@@ -78,8 +78,17 @@ function WebGLAttributes( gl ) {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT,
|
|
|
- array.subarray( updateRange.offset, updateRange.offset + updateRange.count ) );
|
|
|
+ if ( capabilities.isWebGL2 ) {
|
|
|
+
|
|
|
+ gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT,
|
|
|
+ array, updateRange.offset, updateRange.count );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT,
|
|
|
+ array.subarray( updateRange.offset, updateRange.offset + updateRange.count ) );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
updateRange.count = - 1; // reset range
|
|
|
|