Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cocos/2d/renderer/mesh-buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ export class MeshBuffer {

this.floatsPerVertex = getAttributeStride(attrs) >> 2;

var vDataCountLimit = 65536; // 2^16 - 1
let vDataCountLimit = macro.BATCHER2D_MEM_INCREMENT * 256; // 1024 / 4 = 256
const glApi = device.gfxAPI;
if (glApi === API.WEBGPU || glApi === API.WEBGL2 || glApi === API.WEBGL && device.hasFeature(Feature.ELEMENT_INDEX_UINT)) {
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);
}
assertIsTrue(this._initVDataCount / this._floatsPerVertex < vDataCountLimit, getError(9005));

Expand Down
Loading