@@ -14,8 +14,8 @@ import {
14
14
VertexElementFormat
15
15
} from "../graphic" ;
16
16
import { ReturnableObjectPool } from "../utils/ReturnableObjectPool" ;
17
- import { VertexArea } from "./VertexArea" ;
18
17
import { SubPrimitiveChunk } from "./SubPrimitiveChunk" ;
18
+ import { VertexArea } from "./VertexArea" ;
19
19
20
20
/**
21
21
* @internal
@@ -30,7 +30,7 @@ export class PrimitiveChunk {
30
30
indices : Uint16Array ;
31
31
32
32
updateVertexStart = Number . MAX_SAFE_INTEGER ;
33
- updateVertexLength = Number . MIN_SAFE_INTEGER ;
33
+ updateVertexEnd = Number . MIN_SAFE_INTEGER ;
34
34
updateIndexLength = 0 ;
35
35
36
36
vertexFreeAreas : Array < VertexArea > ;
@@ -90,18 +90,18 @@ export class PrimitiveChunk {
90
90
uploadBuffer ( ) : void {
91
91
// Set data option use Discard, or will resulted in performance slowdown when open antialias and cross-rendering of 3D and 2D elements.
92
92
// Device: iphone X(16.7.2)、iphone 15 pro max(17.1.1)、iphone XR(17.1.2) etc.
93
- const { primitive, updateVertexStart, updateVertexLength } = this ;
94
- if ( updateVertexStart !== Number . MAX_SAFE_INTEGER && updateVertexLength !== Number . MIN_SAFE_INTEGER ) {
93
+ const { primitive, updateVertexStart, updateVertexEnd } = this ;
94
+ if ( updateVertexStart !== Number . MAX_SAFE_INTEGER && updateVertexEnd !== Number . MIN_SAFE_INTEGER ) {
95
95
primitive . vertexBufferBindings [ 0 ] . buffer . setData (
96
96
this . vertices ,
97
97
updateVertexStart * 4 ,
98
98
updateVertexStart ,
99
- updateVertexLength ,
99
+ updateVertexEnd - updateVertexStart ,
100
100
SetDataOptions . Discard
101
101
) ;
102
102
103
103
this . updateVertexStart = Number . MAX_SAFE_INTEGER ;
104
- this . updateVertexLength = Number . MIN_SAFE_INTEGER ;
104
+ this . updateVertexEnd = Number . MIN_SAFE_INTEGER ;
105
105
}
106
106
107
107
primitive . indexBufferBinding . buffer . setData ( this . indices , 0 , 0 , this . updateIndexLength , SetDataOptions . Discard ) ;
0 commit comments