Skip to content

Commit

Permalink
remove add PassBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
star-e committed Nov 8, 2024
1 parent 5e0b04f commit c54fe3f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
21 changes: 0 additions & 21 deletions cocos/rendering/custom/framework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { Camera } from '../../render-scene/scene/camera';
import { RenderWindow } from '../../render-scene/core/render-window';
import { supportsR32FloatTexture } from '../define';
import { Format } from '../../gfx/base/define';
import { cclegacy, macro } from '../../core';

export { packRGBE } from '../../core/math/color';

Expand Down Expand Up @@ -103,23 +102,3 @@ export function dispatchResizeEvents (cameras: Camera[], builder: PipelineBuilde
// For editor preview
forceResize = false;
}

let sBuilder: PipelineBuilder;

export function addPipelinePassBuilder (camera: Camera, passBuilder: PipelinePassBuilder): void {
if (!sBuilder) {
sBuilder = cclegacy.rendering.getCustomPipeline(macro.CUSTOM_PIPELINE_NAME);
}
if (sBuilder.addPipelinePassBuilder) {
sBuilder.addPipelinePassBuilder(camera, passBuilder);
}
}

export function removePipelinePassBuilder (camera: Camera, passBuilder: PipelinePassBuilder): void {
if (!sBuilder) {
sBuilder = cclegacy.rendering.getCustomPipeline(macro.CUSTOM_PIPELINE_NAME);
}
if (sBuilder.removePipelinePassBuilder) {
sBuilder.removePipelinePassBuilder(camera, passBuilder);
}
}
3 changes: 1 addition & 2 deletions cocos/rendering/custom/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,7 @@ export interface Pipeline extends BasicPipeline {
export interface PipelinePassBuilder {
getConfigOrder (): number;
getRenderOrder (): number;
resetCamera? (cameraConfigs: { [name: string]: any }): void;
configCamera? (
camera: Readonly<Camera>,
pplConfigs: { readonly [name: string]: any },
Expand Down Expand Up @@ -1708,8 +1709,6 @@ export interface PipelineBuilder {
* @zh 渲染管线状态更新的回调
*/
onGlobalPipelineStateChanged? (): void;
addPipelinePassBuilder? (camera: Camera, passBuilder: PipelinePassBuilder): void;
removePipelinePassBuilder? (camera: Camera, passBuilder: PipelinePassBuilder): void;
}

/**
Expand Down
2 changes: 0 additions & 2 deletions native/cocos/renderer/pipeline/custom/RenderInterfaceTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1787,8 +1787,6 @@ class PipelineBuilder {
* @zh 渲染管线状态更新的回调
*/
virtual void onGlobalPipelineStateChanged() = 0;
virtual void addPipelinePassBuilder(scene::Camera *camera, PipelinePassBuilder *passBuilder) = 0;
virtual void removePipelinePassBuilder(scene::Camera *camera, PipelinePassBuilder *passBuilder) = 0;
};

/**
Expand Down

0 comments on commit c54fe3f

Please sign in to comment.