mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-19 14:52:40 +08:00
fix: destroy index buffer in MeshRenderData.clear() to prevent GPU leak. (#379)
* Changed the GeometryRenderer and DebugRenderer from using intrusive calls to registering callbacks (custom pipeline). * Changed the GeometryRenderer and DebugRenderer from using intrusive calls to registering callbacks. (old pipeline) * CI error: Function parameter names cannot be omitted. * Move the devil string to macro * fix(mesh): hoose index format by max index value in createMesh * perf(pipeline): reduce render queue sort to two packed key compares (native platform). * fix CI error caused by native/cocos/base/Utils.h * fix(scene): LOD screen usage distance truncated to int (native platform) * fix: prevent accessor recursion in SkinnedMeshBatchRenderer. * fix: destroy index buffer in MeshRenderData.clear() to prevent GPU leak.
This commit is contained in:
@@ -735,6 +735,10 @@ export class MeshRenderData extends BaseRenderData {
|
||||
this._vertexBuffers[0].destroy();
|
||||
this._vertexBuffers = [];
|
||||
}
|
||||
if (this._indexBuffer) {
|
||||
this._indexBuffer.destroy();
|
||||
this._indexBuffer = null!;
|
||||
}
|
||||
this._iaInfo = null!;
|
||||
this.vData = new Float32Array(256 * this.stride);
|
||||
this.iData = new Uint16Array(256 * 6);
|
||||
|
||||
Reference in New Issue
Block a user