Skip to content

Commit

Permalink
V3.8.5 pipeline, add PipelinePassBuilder (#17829)
Browse files Browse the repository at this point in the history
  • Loading branch information
star-e authored Nov 8, 2024
1 parent dd7ff20 commit 60fc07a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cocos/rendering/custom/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1657,6 +1657,31 @@ export interface Pipeline extends BasicPipeline {
type: string): number;
}

export interface PipelinePassBuilder {
getConfigOrder (): number;
getRenderOrder (): number;
resetCamera? (cameraConfigs: { [name: string]: any }): void;
configCamera? (
camera: Readonly<Camera>,
pplConfigs: { readonly [name: string]: any },
cameraConfigs: { [name: string]: any }): void;
windowResize? (
ppl: BasicPipeline,
pplConfigs: { readonly [name: string]: any },
cameraConfigs: { readonly [name: string]: any },
window: RenderWindow,
camera: Camera,
width: number,
height: number): void;
setup? (
ppl: BasicPipeline,
pplConfigs: { readonly [name: string]: any },
cameraConfigs: { readonly [name: string]: any },
camera: Camera,
context: { [name: string]: any },
prevRenderPass?: BasicRenderPassBuilder): BasicRenderPassBuilder | undefined;
}

/**
* @en Pipeline builder.
* User can implement this interface and setup render graph.
Expand Down
1 change: 1 addition & 0 deletions native/cocos/renderer/pipeline/custom/RenderInterfaceFwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class RenderPassBuilder;
class MultisampleRenderPassBuilder;
class ComputePassBuilder;
class Pipeline;
class PipelinePassBuilder;
class PipelineBuilder;
class RenderingModule;
class Factory;
Expand Down
13 changes: 13 additions & 0 deletions native/cocos/renderer/pipeline/custom/RenderInterfaceTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1744,6 +1744,19 @@ class Pipeline : public BasicPipeline {
}
};

class PipelinePassBuilder {
public:
PipelinePassBuilder() noexcept = default;
PipelinePassBuilder(PipelinePassBuilder&& rhs) = delete;
PipelinePassBuilder(PipelinePassBuilder const& rhs) = delete;
PipelinePassBuilder& operator=(PipelinePassBuilder&& rhs) = delete;
PipelinePassBuilder& operator=(PipelinePassBuilder const& rhs) = delete;
virtual ~PipelinePassBuilder() noexcept = default;

virtual uint32_t getConfigOrder() const = 0;
virtual uint32_t getRenderOrder() const = 0;
};

/**
* @en Pipeline builder.
* User can implement this interface and setup render graph.
Expand Down

0 comments on commit 60fc07a

Please sign in to comment.