cull web custom pipeline (#11756)

* cull web custom pipeline
This commit is contained in:
hyde zhou
2022-06-29 16:50:10 +08:00
committed by GitHub
parent 06be9a4164
commit fd245ff4f4
6 changed files with 10 additions and 47 deletions
+2 -1
View File
@@ -37,7 +37,8 @@
"intrinsicFlags": {
"MARIONETTE": true
}
}
},
"custom-pipeline": { "modules": ["custom-pipeline"] }
},
"moduleOverrides": [
{
+1 -8
View File
@@ -25,14 +25,7 @@
import { Pipeline } from './pipeline';
import { WebPipeline } from './web-pipeline';
import { rebuildLayoutGraph } from './effect';
import { legacyCC } from '../../global-exports';
export function createCustomPipeline (): Pipeline {
const ppl = new WebPipeline();
const director = legacyCC.director;
if (director.root.usesCustomPipeline) {
director.on(legacyCC.Director.EVENT_BEFORE_DRAW, rebuildLayoutGraph);
}
return ppl;
return new WebPipeline();
}
@@ -1,34 +0,0 @@
/****************************************************************************
Copyright (c) 2021-2022 Xiamen Yaji Software Co., Ltd.
http://www.cocos.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated engine source code (the "Software"), a limited,
worldwide, royalty-free, non-assignable, revocable and non-exclusive license
to use Cocos Creator solely to develop games on your target platforms. You shall
not use Cocos Creator software for developing other software or tools that's
used for developing games. You are not granted to publish, distribute,
sublicense, and/or sell copies of Cocos Creator.
The software or tools in this License Agreement are licensed, not sold.
Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
/**
* ========================= !DO NOT CHANGE THE FOLLOWING SECTION MANUALLY! =========================
* The following section is auto-generated.
* ========================= !DO NOT CHANGE THE FOLLOWING SECTION MANUALLY! =========================
*/
/* eslint-disable max-len */
export class WebImplExample {
name = '';
}
@@ -35,7 +35,6 @@ import { Model, Camera, SKYBOX_FLAG, Light, LightType, ShadowType, DirectionalLi
import { legacyCC } from '../../global-exports';
import { LayoutGraphData } from './layout-graph';
import { Executor } from './executor';
import { WebImplExample } from './web-pipeline-impl';
import { RenderWindow } from '../../renderer/core/render-window';
import { assert, macro } from '../../platform';
import { WebSceneTransversal } from './web-scene';
+3 -3
View File
@@ -39,7 +39,6 @@ import { RenderWindow, IRenderWindowInfo } from './renderer/core/render-window';
import { ColorAttachment, DepthStencilAttachment, RenderPassInfo, StoreOp, Device, Swapchain, Feature } from './gfx';
import { warnID } from './platform/debug';
import { Pipeline, PipelineRuntime } from './pipeline/custom/pipeline';
import { createCustomPipeline } from './pipeline/custom';
import { Batcher2D } from '../2d/renderer/batcher-2d';
import { IPipelineEvent } from './pipeline/pipeline-event';
@@ -376,14 +375,15 @@ export class Root {
//-----------------------------------------------
// choose pipeline
//-----------------------------------------------
if (this.usesCustomPipeline) {
this._customPipeline = createCustomPipeline();
if (this.usesCustomPipeline && legacyCC.internal.createCustomPipeline) {
this._customPipeline = legacyCC.internal.createCustomPipeline();
isCreateDefaultPipeline = true;
this._pipeline = this._customPipeline!;
} else {
this._classicPipeline = rppl;
this._pipeline = this._classicPipeline;
this._pipelineEvent = this._classicPipeline;
this._usesCustomPipeline = false;
}
if (!this._pipeline.activate(this._mainWindow!.swapchain)) {
+4
View File
@@ -0,0 +1,4 @@
import { createCustomPipeline } from '../cocos/core/pipeline/custom';
import { legacyCC } from '../cocos/core/global-exports';
legacyCC.internal.createCustomPipeline = createCustomPipeline;