There was an error while loading. Please reload this page.
1 parent 411f98d commit 3ce1237Copy full SHA for 3ce1237
1 file changed
cocos/2d/renderer/mesh-buffer.ts
@@ -251,10 +251,10 @@ export class MeshBuffer {
251
252
this.floatsPerVertex = getAttributeStride(attrs) >> 2;
253
254
- var vDataCountLimit = 65536; // 2^16 - 1
+ let vDataCountLimit = macro.BATCHER2D_MEM_INCREMENT * 256; // 1024 / 4 = 256
255
const glApi = device.gfxAPI;
256
- if (glApi === API.WEBGPU || glApi === API.WEBGL2 || glApi === API.WEBGL && device.hasFeature(Feature.ELEMENT_INDEX_UINT)) {
257
- vDataCountLimit = 4294967295; // 2^32 - 1
+ if (glApi !== API.WEBGPU && glApi !== API.WEBGL2 && !(glApi === API.WEBGL && device.hasFeature(Feature.ELEMENT_INDEX_UINT))) {
+ vDataCountLimit = Math.min(vDataCountLimit, 65536);
258
}
259
assertIsTrue(this._initVDataCount / this._floatsPerVertex < vDataCountLimit, getError(9005));
260
0 commit comments