1. 内存泄露问题 ,const buffer = new CommandBuffer后 用完将对象置成null,buffermemory 不会下降。
2. 想自己去回收内存, 辗转到Command Buffer中的DrawMeshInstancedCMD 类中,this._curDrawMeshInstancedCMD = cmd.drawMeshInstance(this._mesh,0,this.transformMatrices,this._mat,0,this.materialBlock,this.transformMatrices.length); 这个方法中拿到这个DrawMeshInstancedCMD对象,然后执行recover,发现逻辑bug,如附件中贴图所示,回收对象池的时候把对象拥有的变量给销毁了,如下:
this._instanceBufferState.destroy();
this._instanceBufferState = null;但是在下次Create的时候因为是从池子中拿出来的,所以 this._instanceBufferState 没有了
附件:
归档.zip