Просмотр исходного кода

remove deprecated updateRange (#29298)

Co-authored-by: aardgoose <angus.sawyer@email.com>
aardgoose 1 год назад
Родитель
Сommit
598db0df6a

+ 0 - 9
src/core/BufferAttribute.js

@@ -3,7 +3,6 @@ import { Vector2 } from '../math/Vector2.js';
 import { denormalize, normalize } from '../math/MathUtils.js';
 import { StaticDrawUsage, FloatType } from '../constants.js';
 import { fromHalfFloat, toHalfFloat } from '../extras/DataUtils.js';
-import { warnOnce } from '../utils.js';
 
 const _vector = /*@__PURE__*/ new Vector3();
 const _vector2 = /*@__PURE__*/ new Vector2();
@@ -28,7 +27,6 @@ class BufferAttribute {
 		this.normalized = normalized;
 
 		this.usage = StaticDrawUsage;
-		this._updateRange = { offset: 0, count: - 1 };
 		this.updateRanges = [];
 		this.gpuType = FloatType;
 
@@ -44,13 +42,6 @@ class BufferAttribute {
 
 	}
 
-	get updateRange() {
-
-		warnOnce( 'THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
-		return this._updateRange;
-
-	}
-
 	setUsage( value ) {
 
 		this.usage = value;

+ 0 - 9
src/core/InterleavedBuffer.js

@@ -1,6 +1,5 @@
 import * as MathUtils from '../math/MathUtils.js';
 import { StaticDrawUsage } from '../constants.js';
-import { warnOnce } from '../utils.js';
 
 class InterleavedBuffer {
 
@@ -13,7 +12,6 @@ class InterleavedBuffer {
 		this.count = array !== undefined ? array.length / stride : 0;
 
 		this.usage = StaticDrawUsage;
-		this._updateRange = { offset: 0, count: - 1 };
 		this.updateRanges = [];
 
 		this.version = 0;
@@ -30,13 +28,6 @@ class InterleavedBuffer {
 
 	}
 
-	get updateRange() {
-
-		warnOnce( 'THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
-		return this._updateRange;
-
-	}
-
 	setUsage( value ) {
 
 		this.usage = value;

+ 2 - 15
src/renderers/webgl/WebGLAttributes.js

@@ -76,19 +76,16 @@ function WebGLAttributes( gl ) {
 	function updateBuffer( buffer, attribute, bufferType ) {
 
 		const array = attribute.array;
-		const updateRange = attribute._updateRange; // @deprecated, r159
 		const updateRanges = attribute.updateRanges;
 
 		gl.bindBuffer( bufferType, buffer );
 
-		if ( updateRange.count === - 1 && updateRanges.length === 0 ) {
+		if ( updateRanges.length === 0 ) {
 
 			// Not using update ranges
 			gl.bufferSubData( bufferType, 0, array );
 
-		}
-
-		if ( updateRanges.length !== 0 ) {
+		} else {
 
 			// Before applying update ranges, we merge any adjacent / overlapping
 			// ranges to reduce load on `gl.bufferSubData`. Empirically, this has led
@@ -147,16 +144,6 @@ function WebGLAttributes( gl ) {
 
 		}
 
-		// @deprecated, r159
-		if ( updateRange.count !== - 1 ) {
-
-			gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT,
-				array, updateRange.offset, updateRange.count );
-
-			updateRange.count = - 1; // reset range
-
-		}
-
 		attribute.onUploadCallback();
 
 	}

粤ICP备19079148号