Skip to content

Commit

Permalink
[Fixed] Modify instancing cleanup logic. (cocos#15544)
Browse files Browse the repository at this point in the history
  • Loading branch information
GengineJS authored Jun 27, 2023
1 parent d801230 commit 935bab8
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions cocos/rendering/custom/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,30 @@ class SubmitInfo {
public shadowMap: Map<number, RenderShadowMapBatchedQueue> = new Map<number, RenderShadowMapBatchedQueue>();
public additiveLight: RenderAdditiveLightQueue | null = null;
public reflectionProbe: RenderReflectionProbeQueue | null = null;
reset () {

private _clearInstances () {
const it = this.instances.values(); let res = it.next();
while (!res.done) {
res.value.clear();
res = it.next();
}
this.instances.clear();
}

private _clearShadowMap () {
for (const shadowMap of this.shadowMap) {
shadowMap[1].clear();
}
this.shadowMap.clear();
}

reset () {
this._clearInstances();
this.renderInstanceQueue.length = 0;
this.opaqueList.length = 0;
this.transparentList.length = 0;
this.planarQueue = null;
this.shadowMap.clear();
this._clearShadowMap();
this.additiveLight = null;
this.reflectionProbe = null;
}
Expand Down

0 comments on commit 935bab8

Please sign in to comment.