From fcbe208a9fa0b2f25d21de617a9aff911bdbe98e Mon Sep 17 00:00:00 2001 From: cary <39078800+caryliu1999@users.noreply.github.com> Date: Wed, 30 Dec 2020 20:58:50 +0800 Subject: [PATCH] Fix the crash of render texture scene on metal. (#8056) --- cocos/core/root.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cocos/core/root.ts b/cocos/core/root.ts index 8f862a93df..c90408bc84 100644 --- a/cocos/core/root.ts +++ b/cocos/core/root.ts @@ -400,12 +400,15 @@ export class Root { } legacyCC.director.emit(legacyCC.Director.EVENT_BEFORE_COMMIT); - + const cameraList: Camera[] = []; for (let i = 0; i < windows.length; i++) { const window = windows[i]; const cameras = window.extractRenderCameras(); - this._pipeline.render(cameras); + cameras.forEach((camera) => { + cameraList.push(camera); + }); } + this._pipeline.render(cameraList); this._device.present(); }