未验证 提交 a9913a4d 编写于 作者: M Michael Herzog 提交者: GitHub

Merge pull request #17445 from Mugen87/dev29

BufferAttribute: Deprecate .dynamic, introduce .usage.
......@@ -58,16 +58,6 @@
then this will count the number of such vectors stored.
</p>
<h3>[property:Boolean dynamic]</h3>
<p>
Whether the buffer is dynamic or not. Default is *false*.<br />
If false, the GPU is informed that contents of the buffer are likely to be used often and not change often.
This corresponds to the [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData gl.STATIC_DRAW] flag.<br />
if true, the GPU is informed that contents of the buffer are likely to be used often and change often.
This corresponds to the [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData gl.DYNAMIC_DRAW] flag.
</p>
<h3>[property:Boolean isBufferAttribute]</h3>
<p>
Used to check whether this or derived classes are BufferAttributes. Default is *true*.<br /><br />
......@@ -111,10 +101,16 @@
related to color).
</p>
<h3>[property:Usage usage]</h3>
<p>
Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the *usage* parameter of
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is *THREE.StaticDrawUsage*.
</p>
<h3>[property:Integer version]</h3>
<p>A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.</p>
<h2>Methods</h2>
<h3>[method:BufferAttribute clone]() </h3>
......@@ -178,8 +174,8 @@
being a [page:TypedArray].
</p>
<h3>[method:BufferAttribute setDynamic] ( [param:Boolean value] ) </h3>
<p>Set [page:BufferAttribute.dynamic dynamic] to value.</p>
<h3>[method:BufferAttribute setUsage] ( [param:Usage value] ) </h3>
<p>Set [page:BufferAttribute.usage usage] to value.</p>
<h3>[method:BufferAttribute setX]( [param:Integer index], [param:Float x] ) </h3>
<p>Sets the x component of the vector at the given index.</p>
......
......@@ -44,11 +44,6 @@
Gives the total number of elements in the array.
</p>
<h3>[property:Boolean dynamic]</h3>
<p>
Default is *false*.
</p>
<h3>[property:Object updateRange]</h3>
<p>
Object containing offset and count.
......@@ -79,13 +74,14 @@
Default is *false*. Setting this to true increments [page:InterleavedBuffer.version version].
</p>
<h2>Methods</h2>
<h3>[method:InterleavedBuffer setDynamic] ( [param:Boolean value] ) </h3>
<h3>[property:Usage usage]</h3>
<p>
Set [page:InterleavedBuffer.dynamic dynamic] to value.
Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the *usage* parameter of
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
</p>
<h2>Methods</h2>
<h3>[method:InterleavedBuffer copy]( [param:InterleavedBuffer source] ) </h3>
<p>
Copies another [name] to this [name].
......@@ -107,6 +103,9 @@
Creates a clone of this [name].
</p>
<h3>[method:BufferAttribute setUsage] ( [param:Usage value] ) </h3>
<p>Set [page:BufferAttribute.usage usage] to value.</p>
<h2>Source</h2>
<p>
......
......@@ -52,16 +52,6 @@
若缓存存储三元组(例如顶点位置、法向量、颜色值),则该值应等于队列中三元组的个数。
</p>
<h3>[property:Boolean dynamic]</h3>
<p>
不论缓存是否是动态的,默认值都将是 *false*<br />
如果该值为 false,即告知 GPU 缓存中的数据会经常使用但不经常变化。
该值与 [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData gl.STATIC_DRAW] 标志位相一致。<br />
如果该值为 true,即告知 GPU 缓存中的数据会经常使用且经常变化。
该值与 [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData gl.DYNAMIC_DRAW] 标志位相一致。
</p>
<h3>[property:Boolean isBufferAttribute]</h3>
<p>
指示当前类或派生类是 BufferAttributes. 默认值为 *true*.<br /><br />
......@@ -101,6 +91,13 @@
该值只可以被用于更新某些矢量数据(例如,颜色相关数据)。
</p>
<h3>[property:Usage usage]</h3>
<p>
Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the *usage* parameter of
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is *THREE.StaticDrawUsage*.
</p>
<h3>[property:Integer version]</h3>
<p>版本号,当 [page:BufferAttribute.needsUpdate needsUpdate] 被设置为 true 时,该值会自增。</p>
......@@ -158,8 +155,8 @@
特别的, 对将 [page:Array value] 转为 [page:TypedArray] 的要求详见上述链接。
</p>
<h3>[method:BufferAttribute setDynamic] ( [param:Boolean value] ) </h3>
<p>将 [page:BufferAttribute.dynamic dynamic] 设置为 value.</p>
<h3>[method:BufferAttribute setUsage] ( [param:Usage value] ) </h3>
<p>Set [page:BufferAttribute.usage usage] to value.</p>
<h3>[method:BufferAttribute setX]( [param:Integer index], [param:Float x] ) </h3>
<p>设置给定索引的矢量的第一维数据(设置 X 值)。</p>
......
......@@ -44,11 +44,6 @@
类型化队列中,所有元素的数目。
</p>
<h3>[property:Boolean dynamic]</h3>
<p>
默认值为 *false*。
</p>
<h3>[property:Object updateRange]</h3>
<p>
对象存储着需要更新的数据的偏移量和数量。
......@@ -79,13 +74,14 @@
默认值为 *false*。该值被设置为 true 时,会导致 [page:InterleavedBuffer.version version] 增加。
</p>
<h2>方法</h2>
<h3>[method:InterleavedBuffer setDynamic] ( [param:Boolean value] ) </h3>
<h3>[property:Usage usage]</h3>
<p>
根据输入参数设置 [page:InterleavedBuffer.dynamic dynamic] 的值。
Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the *usage* parameter of
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
</p>
<h2>方法</h2>
<h3>[method:InterleavedBuffer copy]( [param:InterleavedBuffer source] ) </h3>
<p>
将参数指定的 [name] 拷贝到当前 [name]。
......@@ -107,6 +103,9 @@
克隆当前 [name]。
</p>
<h3>[method:BufferAttribute setUsage] ( [param:Usage value] ) </h3>
<p>Set [page:BufferAttribute.usage usage] to value.</p>
<h2>源代码</h2>
<p>
......
......@@ -430,11 +430,11 @@ THREE.LightningStrike.prototype.createMesh = function () {
if ( ! this.isStatic ) {
this.index.dynamic = true;
this.positionAttribute.dynamic = true;
this.index.usage = THREE.DynamicDrawUsage;
this.positionAttribute.usage = THREE.DynamicDrawUsage;
if ( this.generateUVs ) {
this.uvsAttribute.dynamic = true;
this.uvsAttribute.usage = THREE.DynamicDrawUsage;
}
......
......@@ -103,6 +103,7 @@
import {
BufferGeometry,
DynamicDrawUsage,
Float32BufferAttribute,
Math as _Math,
Uint32BufferAttribute,
......@@ -439,11 +440,11 @@ LightningStrike.prototype.createMesh = function () {
if ( ! this.isStatic ) {
this.index.dynamic = true;
this.positionAttribute.dynamic = true;
this.index.usage = DynamicDrawUsage;
this.positionAttribute.usage = DynamicDrawUsage;
if ( this.generateUVs ) {
this.uvsAttribute.dynamic = true;
this.uvsAttribute.usage = DynamicDrawUsage;
}
......
......@@ -114,7 +114,7 @@
geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) );
geometry.addAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) );
geometry.addAttribute( 'size', new THREE.Float32BufferAttribute( sizes, 1 ).setDynamic( true ) );
geometry.addAttribute( 'size', new THREE.Float32BufferAttribute( sizes, 1 ).setUsage( THREE.DynamicDrawUsage ) );
particleSystem = new THREE.Points( geometry, shaderMaterial );
......
......@@ -139,7 +139,7 @@
}
particles.setDrawRange( 0, particleCount );
particles.addAttribute( 'position', new THREE.BufferAttribute( particlePositions, 3 ).setDynamic( true ) );
particles.addAttribute( 'position', new THREE.BufferAttribute( particlePositions, 3 ).setUsage( THREE.DynamicDrawUsage ) );
// create the particle system
pointCloud = new THREE.Points( particles, pMaterial );
......@@ -147,8 +147,8 @@
var geometry = new THREE.BufferGeometry();
geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ).setDynamic( true ) );
geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ).setDynamic( true ) );
geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ).setUsage( THREE.DynamicDrawUsage ) );
geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ).setUsage( THREE.DynamicDrawUsage ) );
geometry.computeBoundingSphere();
......
......@@ -147,7 +147,7 @@
}
offsetAttribute = new THREE.InstancedBufferAttribute( new Float32Array( offsets ), 3 );
orientationAttribute = new THREE.InstancedBufferAttribute( new Float32Array( orientations ), 4 ).setDynamic( true );
orientationAttribute = new THREE.InstancedBufferAttribute( new Float32Array( orientations ), 4 ).setUsage( THREE.DynamicDrawUsage );
geometry.addAttribute( 'offset', offsetAttribute );
geometry.addAttribute( 'orientation', orientationAttribute );
......
......@@ -162,7 +162,7 @@
geometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );
// per instance data
instanceBuffer = new THREE.InstancedInterleavedBuffer( new Float32Array( instances * 8 ), 8, 1 ).setDynamic( true );
instanceBuffer = new THREE.InstancedInterleavedBuffer( new Float32Array( instances * 8 ), 8, 1 ).setUsage( THREE.DynamicDrawUsage );
var offsets = new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 0 );
var vector = new THREE.Vector4();
......
......@@ -58,7 +58,7 @@
geometry.rotateX( - Math.PI / 2 );
var position = geometry.attributes.position;
position.dynamic = true;
position.usage = THREE.DynamicDrawUsage;
for ( var i = 0; i < position.count; i ++ ) {
......
......@@ -180,7 +180,7 @@
geometry.addAttribute( 'position', positions.clone() );
geometry.addAttribute( 'initialPosition', positions.clone() );
geometry.attributes.position.setDynamic( true );
geometry.attributes.position.setUsage( THREE.DynamicDrawUsage );
var clones = [
......
......@@ -73,7 +73,7 @@
if ( attributes.color === undefined ) {
var colors = new Float32Array( positions.length );
geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ).setDynamic( true ) );
geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ).setUsage( THREE.DynamicDrawUsage ) );
}
......
......@@ -146,15 +146,15 @@
var geometry = new THREE.BufferGeometry();
var positions = new THREE.BufferAttribute( new Float32Array( 1000000 * 3 ), 3 );
positions.dynamic = true;
positions.usage = THREE.DynamicDrawUsage;
geometry.addAttribute( 'position', positions );
var normals = new THREE.BufferAttribute( new Float32Array( 1000000 * 3 ), 3 );
normals.dynamic = true;
normals.usage = THREE.DynamicDrawUsage;
geometry.addAttribute( 'normal', normals );
var colors = new THREE.BufferAttribute( new Float32Array( 1000000 * 3 ), 3 );
colors.dynamic = true;
colors.usage = THREE.DynamicDrawUsage;
geometry.addAttribute( 'color', colors );
geometry.drawRange.count = 0;
......
......@@ -169,15 +169,15 @@
var geometry = new THREE.BufferGeometry();
var positions = new THREE.BufferAttribute( new Float32Array( 1000000 * 3 ), 3 );
positions.dynamic = true;
positions.usage = THREE.DynamicDrawUsage;
geometry.addAttribute( 'position', positions );
var normals = new THREE.BufferAttribute( new Float32Array( 1000000 * 3 ), 3 );
normals.dynamic = true;
normals.usage = THREE.DynamicDrawUsage;
geometry.addAttribute( 'normal', normals );
var colors = new THREE.BufferAttribute( new Float32Array( 1000000 * 3 ), 3 );
colors.dynamic = true;
colors.usage = THREE.DynamicDrawUsage;
geometry.addAttribute( 'color', colors );
geometry.drawRange.count = 0;
......
......@@ -5,7 +5,11 @@
import { Audio } from './audio/Audio.js';
import { AudioAnalyser } from './audio/AudioAnalyser.js';
import { PerspectiveCamera } from './cameras/PerspectiveCamera.js';
import { FlatShading } from './constants.js';
import {
FlatShading,
StaticDrawUsage,
DynamicDrawUsage
} from './constants.js';
import {
Float64BufferAttribute,
Float32BufferAttribute,
......@@ -1163,13 +1167,33 @@ Object.defineProperties( BufferAttribute.prototype, {
console.warn( 'THREE.BufferAttribute: .length has been deprecated. Use .count instead.' );
return this.array.length;
}
},
dynamic: {
get: function () {
console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' );
return this.usage === DynamicDrawUsage;
},
set: function ( value ) {
console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' );
this.setUsage( value );
}
}
} );
Object.assign( BufferAttribute.prototype, {
setDynamic: function ( value ) {
console.warn( 'THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.' );
this.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage );
return this;
},
copyIndicesArray: function ( /* indices */ ) {
console.error( 'THREE.BufferAttribute: .copyIndicesArray() has been removed.' );
......@@ -1185,7 +1209,6 @@ Object.assign( BufferAttribute.prototype, {
return this;
}
} );
Object.assign( BufferGeometry.prototype, {
......@@ -1247,8 +1270,33 @@ Object.defineProperties( BufferGeometry.prototype, {
} );
Object.defineProperties( InterleavedBuffer.prototype, {
dynamic: {
get: function () {
console.warn( 'THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead.' );
return this.usage === DynamicDrawUsage;
},
set: function ( value ) {
console.warn( 'THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead.' );
this.setUsage( value );
}
}
} );
Object.assign( InterleavedBuffer.prototype, {
setDynamic: function ( value ) {
console.warn( 'THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.' );
this.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage );
return this;
},
setArray: function ( array ) {
console.warn( 'THREE.InterleavedBuffer: .setArray has been deprecated. Use BufferGeometry .setAttribute to replace/resize attribute buffers' );
......@@ -1259,7 +1307,6 @@ Object.assign( InterleavedBuffer.prototype, {
return this;
}
} );
//
......
......@@ -275,3 +275,15 @@ export const GreaterStencilFunc: StencilFunc;
export const NotEqualStencilFunc: StencilFunc;
export const GreaterEqualStencilFunc: StencilFunc;
export const AlwaysStencilFunc: StencilFunc;
// usage types
export enum Usage {}
export const StaticDrawUsage: Usage;
export const DynamicDrawUsage: Usage;
export const StreamDrawUsage: Usage;
export const StaticReadUsage: Usage;
export const DynamicReadUsage: Usage;
export const StreamReadUsage: Usage;
export const StaticCopyUsage: Usage;
export const DynamicCopyUsage: Usage;
export const StreamCopyUsage: Usage;
......@@ -166,3 +166,13 @@ export var GreaterStencilFunc = 516;
export var NotEqualStencilFunc = 517;
export var GreaterEqualStencilFunc = 518;
export var AlwaysStencilFunc = 519;
export var StaticDrawUsage = 35044;
export var DynamicDrawUsage = 35048;
export var StreamDrawUsage = 35040;
export var StaticReadUsage = 35045;
export var DynamicReadUsage = 35049;
export var StreamReadUsage = 35041;
export var StaticCopyUsage = 35046;
export var DynamicCopyUsage = 35050;
export var StreamCopyUsage = 35042;
import {
Usage
} from '../constants';
/**
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js">src/core/BufferAttribute.js</a>
*/
......@@ -8,7 +12,7 @@ export class BufferAttribute {
name: string;
array: ArrayLike<number>;
itemSize: number;
dynamic: boolean;
usage: Usage;
updateRange: { offset: number; count: number };
version: number;
normalized: boolean;
......@@ -16,7 +20,7 @@ export class BufferAttribute {
count: number;
onUpload: Function;
setDynamic( dynamic: boolean ): BufferAttribute;
setUsage( usage: Usage ): BufferAttribute;
clone(): this;
copy( source: BufferAttribute ): this;
copyAt(
......
......@@ -2,6 +2,7 @@ import { Vector4 } from '../math/Vector4.js';
import { Vector3 } from '../math/Vector3.js';
import { Vector2 } from '../math/Vector2.js';
import { Color } from '../math/Color.js';
import { StaticDrawUsage } from '../constants.js';
/**
* @author mrdoob / http://mrdoob.com/
......@@ -22,7 +23,7 @@ function BufferAttribute( array, itemSize, normalized ) {
this.count = array !== undefined ? array.length / itemSize : 0;
this.normalized = normalized === true;
this.dynamic = false;
this.usage = StaticDrawUsage;
this.updateRange = { offset: 0, count: - 1 };
this.version = 0;
......@@ -45,9 +46,9 @@ Object.assign( BufferAttribute.prototype, {
onUploadCallback: function () {},
setDynamic: function ( value ) {
setUsage: function ( value ) {
this.dynamic = value;
this.usage = value;
return this;
......@@ -61,7 +62,7 @@ Object.assign( BufferAttribute.prototype, {
this.count = source.count;
this.normalized = source.normalized;
this.dynamic = source.dynamic;
this.usage = source.usage;
return this;
......
import { InterleavedBufferAttribute } from './InterleavedBufferAttribute';
import { Usage } from '../constants';
/**
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/InterleavedBuffer.js">src/core/InterleavedBuffer.js</a>
......@@ -9,14 +10,14 @@ export class InterleavedBuffer {
array: ArrayLike<number>;
stride: number;
dynamic: boolean;
usage: Usage;
updateRange: { offset: number; count: number };
version: number;
length: number;
count: number;
needsUpdate: boolean;
setDynamic( dynamic: boolean ): InterleavedBuffer;
setUsage( usage: Usage ): InterleavedBuffer;
clone(): this;
copy( source: InterleavedBuffer ): this;
copyAt(
......
import { StaticDrawUsage } from '../constants.js';
/**
* @author benaadams / https://twitter.com/ben_a_adams
......@@ -9,7 +10,7 @@ function InterleavedBuffer( array, stride ) {
this.stride = stride;
this.count = array !== undefined ? array.length / stride : 0;
this.dynamic = false;
this.usage = StaticDrawUsage;
this.updateRange = { offset: 0, count: - 1 };
this.version = 0;
......@@ -32,9 +33,9 @@ Object.assign( InterleavedBuffer.prototype, {
onUploadCallback: function () {},
setDynamic: function ( value ) {
setUsage: function ( value ) {
this.dynamic = value;
this.usage = value;
return this;
......@@ -45,7 +46,7 @@ Object.assign( InterleavedBuffer.prototype, {
this.array = new source.array.constructor( source.array );
this.count = source.count;
this.stride = source.stride;
this.dynamic = source.dynamic;
this.usage = source.usage;
return this;
......
......@@ -9,7 +9,7 @@ function WebGLAttributes( gl ) {
function createBuffer( attribute, bufferType ) {
var array = attribute.array;
var usage = attribute.dynamic ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW;
var usage = attribute.usage;
var buffer = gl.createBuffer();
......@@ -70,20 +70,12 @@ function WebGLAttributes( gl ) {
gl.bindBuffer( bufferType, buffer );
if ( attribute.dynamic === false ) {
gl.bufferData( bufferType, array, gl.STATIC_DRAW );
} else if ( updateRange.count === - 1 ) {
if ( updateRange.count === - 1 ) {
// Not using update ranges
gl.bufferSubData( bufferType, 0, array );
} else if ( updateRange.count === 0 ) {
console.error( 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.' );
} else {
gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT,
......
......@@ -8,6 +8,7 @@ import { Color } from '../../../../src/math/Color';
import { Vector2 } from '../../../../src/math/Vector2';
import { Vector3 } from '../../../../src/math/Vector3';
import { Vector4 } from '../../../../src/math/Vector4';
import { DynamicDrawUsage } from '../../../../src/constants';
export default QUnit.module( 'Core', () => {
......@@ -42,23 +43,26 @@ export default QUnit.module( 'Core', () => {
} );
QUnit.todo( "setDynamic", ( assert ) => {
QUnit.test( "setUsage", ( assert ) => {
assert.ok( false, "everything's gonna be alright" );
var attr = new BufferAttribute();
attr.setUsage( DynamicDrawUsage );
assert.strictEqual( attr.usage, DynamicDrawUsage, "Usage was set" );
} );
QUnit.test( "copy", ( assert ) => {
var attr = new BufferAttribute( new Float32Array( [ 1, 2, 3, 4, 5, 6 ] ), 3 );
attr.setDynamic( true );
attr.setUsage( DynamicDrawUsage );
attr.needsUpdate = true;
var attrCopy = new BufferAttribute().copy( attr );
assert.ok( attr.count === attrCopy.count, 'count is equal' );
assert.ok( attr.itemSize === attrCopy.itemSize, 'itemSize is equal' );
assert.ok( attr.dynamic === attrCopy.dynamic, 'dynamic is equal' );
assert.ok( attr.usage === attrCopy.usage, 'usage is equal' );
assert.ok( attr.array.length === attrCopy.array.length, 'array length is equal' );
assert.ok( attr.version === 1 && attrCopy.version === 0, 'version is not copied which is good' );
......
......@@ -4,6 +4,7 @@
/* global QUnit */
import { InterleavedBuffer } from '../../../../src/core/InterleavedBuffer';
import { DynamicDrawUsage } from '../../../../src/constants';
export default QUnit.module( 'Core', () => {
......@@ -20,7 +21,7 @@ export default QUnit.module( 'Core', () => {
}
assert.ok( copiedInstance.stride === instance.stride, "stride was copied" );
assert.ok( copiedInstance.dynamic === true, "dynamic was copied" );
assert.ok( copiedInstance.usage === DynamicDrawUsage, "usage was copied" );
}
......@@ -49,9 +50,12 @@ export default QUnit.module( 'Core', () => {
} );
QUnit.todo( "setDynamic", ( assert ) => {
QUnit.test( "setUsage", ( assert ) => {
assert.ok( false, "everything's gonna be alright" );
var instance = new InterleavedBuffer();
instance.setUsage( DynamicDrawUsage );
assert.strictEqual( instance.usage, DynamicDrawUsage, "Usage was set" );
} );
......@@ -59,7 +63,7 @@ export default QUnit.module( 'Core', () => {
var array = new Float32Array( [ 1, 2, 3, 7, 8, 9 ] );
var instance = new InterleavedBuffer( array, 3 );
instance.setDynamic( true );
instance.setUsage( DynamicDrawUsage );
checkInstanceAgainstCopy( instance, instance.copy( instance ), assert );
......@@ -92,7 +96,7 @@ export default QUnit.module( 'Core', () => {
var array = new Float32Array( [ 1, 2, 3, 7, 8, 9 ] );
var instance = new InterleavedBuffer( array, 3 );
instance.setDynamic( true );
instance.setUsage( DynamicDrawUsage );
checkInstanceAgainstCopy( instance, instance.clone(), assert );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册