diff --git a/cocos/rendering/custom/pipeline.ts b/cocos/rendering/custom/pipeline.ts index de81a7be7e1..fa1d293e202 100644 --- a/cocos/rendering/custom/pipeline.ts +++ b/cocos/rendering/custom/pipeline.ts @@ -644,9 +644,13 @@ export interface BasicRenderPassBuilder extends Setter { * * @param hint @en Usage hint of the queue @zh 用途的提示 * @param phaseName @en The name of the phase declared in the effect. Default value is 'default' @zh effect中相位(phase)的名字,缺省为'default'。 + * @param passName @en The name of the pass declared in the effect. It is used to override the pass name in the parent pass/subpass. @zh effect中通道(pass)的名字,会覆盖(override)父(通道/子通道)中已设置的pass名字。 * @returns @en render queue builder @zh 渲染队列 */ - addQueue (hint?: QueueHint, phaseName?: string): RenderQueueBuilder; + addQueue ( + hint?: QueueHint, + phaseName?: string, + passName?: string): RenderQueueBuilder; /** * @en Set rendering viewport. * @zh 设置渲染视口 @@ -1160,9 +1164,13 @@ export interface RenderSubpassBuilder extends Setter { * * @param hint @en Usage hint of the queue @zh 用途的提示 * @param phaseName @en The name of the phase declared in the effect. Default value is 'default' @zh effect中相位(phase)的名字,缺省为'default'。 + * @param passName @en The name of the pass declared in the effect. It is used to override the pass name in the parent pass/subpass. @zh effect中通道(pass)的名字,会覆盖(override)父(通道/子通道)中已设置的pass名字。 * @returns @en render queue builder @zh 渲染队列 */ - addQueue (hint?: QueueHint, phaseName?: string): RenderQueueBuilder; + addQueue ( + hint?: QueueHint, + phaseName?: string, + passName?: string): RenderQueueBuilder; /** * @en Show statistics on screen * @zh 在屏幕上渲染统计数据 @@ -1298,9 +1306,10 @@ export interface ComputeSubpassBuilder extends Setter { * * @param hint @en Usage hint of the queue @zh 用途的提示 * @param phaseName @en The name of the phase declared in the effect. Default value is 'default' @zh effect中相位(phase)的名字,缺省为'default'。 + * @param passName @en The name of the pass declared in the effect. It is used to override the pass name in the parent pass/subpass. @zh effect中通道(pass)的名字,会覆盖(override)父(通道/子通道)中已设置的pass名字。 * @returns @en compute queue builder @zh 计算队列 */ - addQueue (phaseName?: string): ComputeQueueBuilder; + addQueue (phaseName?: string, passName?: string): ComputeQueueBuilder; /** * @experimental */ @@ -1476,9 +1485,10 @@ export interface ComputePassBuilder extends Setter { * * @param hint @en Usage hint of the queue @zh 用途的提示 * @param phaseName @en The name of the phase declared in the effect. Default value is 'default' @zh effect中相位(phase)的名字,缺省为'default'。 + * @param passName @en The name of the pass declared in the effect. It is used to override the pass name in the parent pass/subpass. @zh effect中通道(pass)的名字,会覆盖(override)父(通道/子通道)中已设置的pass名字。 * @returns @en compute queue builder @zh 计算队列 */ - addQueue (phaseName?: string): ComputeQueueBuilder; + addQueue (phaseName?: string, passName?: string): ComputeQueueBuilder; /** * @experimental */ diff --git a/cocos/rendering/custom/render-graph.ts b/cocos/rendering/custom/render-graph.ts index 135d22cd640..13edc899808 100644 --- a/cocos/rendering/custom/render-graph.ts +++ b/cocos/rendering/custom/render-graph.ts @@ -1505,17 +1505,20 @@ export class ClearView { } export class RenderQueue { - constructor (hint: QueueHint = QueueHint.RENDER_OPAQUE, phaseID = 0xFFFFFFFF) { + constructor (hint: QueueHint = QueueHint.RENDER_OPAQUE, phaseID = 0xFFFFFFFF, passLayoutID = 0xFFFFFFFF) { this.hint = hint; this.phaseID = phaseID; + this.passLayoutID = passLayoutID; } - reset (hint: QueueHint = QueueHint.RENDER_OPAQUE, phaseID = 0xFFFFFFFF): void { + reset (hint: QueueHint = QueueHint.RENDER_OPAQUE, phaseID = 0xFFFFFFFF, passLayoutID = 0xFFFFFFFF): void { this.hint = hint; this.phaseID = phaseID; + this.passLayoutID = passLayoutID; this.viewport = null; } hint: QueueHint; phaseID: number; + passLayoutID: number; viewport: Viewport | null = null; } @@ -2840,9 +2843,10 @@ export class RenderGraphObjectPool { createRenderQueue ( hint: QueueHint = QueueHint.RENDER_OPAQUE, phaseID = 0xFFFFFFFF, + passLayoutID = 0xFFFFFFFF, ): RenderQueue { const v = this._renderQueue.add(); - v.reset(hint, phaseID); + v.reset(hint, phaseID, passLayoutID); return v; } createSceneData ( diff --git a/cocos/rendering/custom/web-pipeline.ts b/cocos/rendering/custom/web-pipeline.ts index 9a4f7e22dcc..46f8d487738 100644 --- a/cocos/rendering/custom/web-pipeline.ts +++ b/cocos/rendering/custom/web-pipeline.ts @@ -454,7 +454,7 @@ export class WebRenderSubpassBuilder extends WebSetter implements RenderSubpassB setViewport (viewport: Viewport): void { throw new Error('Method not implemented.'); } - addQueue (hint: QueueHint = QueueHint.RENDER_OPAQUE, layoutName = 'default'): RenderQueueBuilder { + addQueue (hint: QueueHint = QueueHint.RENDER_OPAQUE, layoutName = 'default', passName = ''): RenderQueueBuilder { const layoutId = this._lg.locateChild(this._layoutID, layoutName); if (DEBUG) { assert(layoutId !== 0xFFFFFFFF); @@ -604,7 +604,7 @@ export class WebRenderPassBuilder extends WebSetter implements BasicMultisampleR result.update(data, this._renderGraph, this._lg, vertID, subpass, this._pipeline); return result; } - addQueue (hint: QueueHint = QueueHint.RENDER_OPAQUE, layoutName = 'default'): WebRenderQueueBuilder { + addQueue (hint: QueueHint = QueueHint.RENDER_OPAQUE, layoutName = 'default', passName = ''): WebRenderQueueBuilder { const layoutId = this._lg.locateChild(this._layoutID, layoutName); if (DEBUG) { assert(layoutId !== 0xFFFFFFFF); @@ -776,7 +776,7 @@ export class WebComputePassBuilder extends WebSetter implements ComputePassBuild addMaterialTexture (resourceName: string, flags?: ShaderStageFlagBit | undefined): void { throw new Error('Method not implemented.'); } - addQueue (layoutName = 'default'): WebComputeQueueBuilder { + addQueue (layoutName = 'default', passName = ''): WebComputeQueueBuilder { const layoutId = this._lg.locateChild(this._layoutID, layoutName); if (DEBUG) { assert(layoutId !== 0xFFFFFFFF); diff --git a/native/cocos/renderer/pipeline/custom/NativePipelineTypes.h b/native/cocos/renderer/pipeline/custom/NativePipelineTypes.h index a9fe54508ad..f4f34502d17 100644 --- a/native/cocos/renderer/pipeline/custom/NativePipelineTypes.h +++ b/native/cocos/renderer/pipeline/custom/NativePipelineTypes.h @@ -209,7 +209,7 @@ class NativeRenderSubpassBuilderImpl : public NativeSetter { void addStorageBuffer(const ccstd::string &name, AccessType accessType, const ccstd::string &slotName) /*implements*/; void addStorageImage(const ccstd::string &name, AccessType accessType, const ccstd::string &slotName) /*implements*/; void setViewport(const gfx::Viewport &viewport) /*implements*/; - RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName) /*implements*/; + RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName, const ccstd::string &passName) /*implements*/; bool getShowStatistics() const /*implements*/; void setShowStatistics(bool enable) /*implements*/; void setCustomShaderStages(const ccstd::string &name, gfx::ShaderStageFlagBit stageFlags) /*implements*/; @@ -400,8 +400,8 @@ class NativeRenderSubpassBuilder final : public RenderSubpassBuilder, public Nat void setViewport(const gfx::Viewport &viewport) override { NativeRenderSubpassBuilderImpl::setViewport(viewport); } - RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName) override { - return NativeRenderSubpassBuilderImpl::addQueue(hint, phaseName); + RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName, const ccstd::string &passName) override { + return NativeRenderSubpassBuilderImpl::addQueue(hint, phaseName, passName); } bool getShowStatistics() const override { return NativeRenderSubpassBuilderImpl::getShowStatistics(); @@ -511,8 +511,8 @@ class NativeMultisampleRenderSubpassBuilder final : public MultisampleRenderSubp void setViewport(const gfx::Viewport &viewport) override { NativeRenderSubpassBuilderImpl::setViewport(viewport); } - RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName) override { - return NativeRenderSubpassBuilderImpl::addQueue(hint, phaseName); + RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName, const ccstd::string &passName) override { + return NativeRenderSubpassBuilderImpl::addQueue(hint, phaseName, passName); } bool getShowStatistics() const override { return NativeRenderSubpassBuilderImpl::getShowStatistics(); @@ -611,7 +611,7 @@ class NativeComputeSubpassBuilder final : public ComputeSubpassBuilder, public N void addTexture(const ccstd::string &name, const ccstd::string &slotName, gfx::Sampler *sampler, uint32_t plane) override; void addStorageBuffer(const ccstd::string &name, AccessType accessType, const ccstd::string &slotName) override; void addStorageImage(const ccstd::string &name, AccessType accessType, const ccstd::string &slotName) override; - ComputeQueueBuilder *addQueue(const ccstd::string &phaseName) override; + ComputeQueueBuilder *addQueue(const ccstd::string &phaseName, const ccstd::string &passName) override; void setCustomShaderStages(const ccstd::string &name, gfx::ShaderStageFlagBit stageFlags) override; }; @@ -697,7 +697,7 @@ class NativeRenderPassBuilder final : public RenderPassBuilder, public NativeSet void addRenderTarget(const ccstd::string &name, gfx::LoadOp loadOp, gfx::StoreOp storeOp, const gfx::Color &color) override; void addDepthStencil(const ccstd::string &name, gfx::LoadOp loadOp, gfx::StoreOp storeOp, float depth, uint8_t stencil, gfx::ClearFlagBit clearFlags) override; void addTexture(const ccstd::string &name, const ccstd::string &slotName, gfx::Sampler *sampler, uint32_t plane) override; - RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName) override; + RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName, const ccstd::string &passName) override; void setViewport(const gfx::Viewport &viewport) override; void setVersion(const ccstd::string &name, uint64_t version) override; bool getShowStatistics() const override; @@ -796,7 +796,7 @@ class NativeMultisampleRenderPassBuilder final : public MultisampleRenderPassBui void addRenderTarget(const ccstd::string &name, gfx::LoadOp loadOp, gfx::StoreOp storeOp, const gfx::Color &color) override; void addDepthStencil(const ccstd::string &name, gfx::LoadOp loadOp, gfx::StoreOp storeOp, float depth, uint8_t stencil, gfx::ClearFlagBit clearFlags) override; void addTexture(const ccstd::string &name, const ccstd::string &slotName, gfx::Sampler *sampler, uint32_t plane) override; - RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName) override; + RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName, const ccstd::string &passName) override; void setViewport(const gfx::Viewport &viewport) override; void setVersion(const ccstd::string &name, uint64_t version) override; bool getShowStatistics() const override; @@ -977,7 +977,7 @@ class NativeComputePassBuilder final : public ComputePassBuilder, public NativeS void addStorageBuffer(const ccstd::string &name, AccessType accessType, const ccstd::string &slotName) override; void addStorageImage(const ccstd::string &name, AccessType accessType, const ccstd::string &slotName) override; void addMaterialTexture(const ccstd::string &resourceName, gfx::ShaderStageFlagBit flags) override; - ComputeQueueBuilder *addQueue(const ccstd::string &phaseName) override; + ComputeQueueBuilder *addQueue(const ccstd::string &phaseName, const ccstd::string &passName) override; void setCustomShaderStages(const ccstd::string &name, gfx::ShaderStageFlagBit stageFlags) override; }; diff --git a/native/cocos/renderer/pipeline/custom/NativeRenderGraph.cpp b/native/cocos/renderer/pipeline/custom/NativeRenderGraph.cpp index 1560ee5cec4..e7dda6f1980 100644 --- a/native/cocos/renderer/pipeline/custom/NativeRenderGraph.cpp +++ b/native/cocos/renderer/pipeline/custom/NativeRenderGraph.cpp @@ -517,11 +517,17 @@ void NativeRenderSubpassBuilderImpl::setViewport(const gfx::Viewport &viewport) } RenderQueueBuilder *NativeRenderSubpassBuilderImpl::addQueue( - QueueHint hint, const ccstd::string &phaseName) { + QueueHint hint, const ccstd::string &phaseName, const ccstd::string &passName) { CC_EXPECTS(!phaseName.empty()); CC_EXPECTS(layoutID != LayoutGraphData::null_vertex()); - const auto phaseLayoutID = locate(layoutID, phaseName, *layoutGraph); + const auto passLayoutID = + passName.empty() + ? layoutID + : locate(LayoutGraphData::null_vertex(), passName, *layoutGraph); + CC_ENSURES(passLayoutID != LayoutGraphData::null_vertex()); + + const auto phaseLayoutID = locate(passLayoutID, phaseName, *layoutGraph); CC_ENSURES(phaseLayoutID != LayoutGraphData::null_vertex()); auto queueID = addVertex2( @@ -530,7 +536,7 @@ RenderQueueBuilder *NativeRenderSubpassBuilderImpl::addQueue( std::forward_as_tuple(phaseName), std::forward_as_tuple(), std::forward_as_tuple(), - std::forward_as_tuple(hint, phaseLayoutID), + std::forward_as_tuple(hint, phaseLayoutID, passLayoutID), *renderGraph, nodeID); return new NativeRenderQueueBuilder(pipelineRuntime, renderGraph, queueID, layoutGraph, phaseLayoutID); @@ -671,11 +677,18 @@ void NativeComputeSubpassBuilder::setCustomShaderStages( setSubpassResourceShaderStages(*renderGraph, nodeID, name, stageFlags); } -ComputeQueueBuilder *NativeComputeSubpassBuilder::addQueue(const ccstd::string &phaseName) { +ComputeQueueBuilder *NativeComputeSubpassBuilder::addQueue( + const ccstd::string &phaseName, const ccstd::string &passName) { CC_EXPECTS(!phaseName.empty()); CC_EXPECTS(layoutID != LayoutGraphData::null_vertex()); - const auto phaseLayoutID = locate(layoutID, phaseName, *layoutGraph); + const auto passLayoutID = + passName.empty() + ? layoutID + : locate(LayoutGraphData::null_vertex(), passName, *layoutGraph); + CC_ENSURES(passLayoutID != LayoutGraphData::null_vertex()); + + const auto phaseLayoutID = locate(passLayoutID, phaseName, *layoutGraph); CC_ENSURES(phaseLayoutID != LayoutGraphData::null_vertex()); auto queueID = addVertex2( @@ -684,7 +697,7 @@ ComputeQueueBuilder *NativeComputeSubpassBuilder::addQueue(const ccstd::string & std::forward_as_tuple(phaseName), std::forward_as_tuple(), std::forward_as_tuple(), - std::forward_as_tuple(phaseLayoutID), + std::forward_as_tuple(phaseLayoutID, passLayoutID), *renderGraph, nodeID); return new NativeComputeQueueBuilder(pipelineRuntime, renderGraph, queueID, layoutGraph, phaseLayoutID); @@ -991,11 +1004,17 @@ void NativeRenderQueueBuilder::addCustomCommand(std::string_view customBehavior) } RenderQueueBuilder *NativeRenderPassBuilder::addQueue( - QueueHint hint, const ccstd::string &phaseName) { + QueueHint hint, const ccstd::string &phaseName, const ccstd::string &passName) { CC_EXPECTS(!phaseName.empty()); CC_EXPECTS(layoutID != LayoutGraphData::null_vertex()); - const auto phaseLayoutID = locate(layoutID, phaseName, *layoutGraph); + const auto passLayoutID = + passName.empty() + ? layoutID + : locate(LayoutGraphData::null_vertex(), passName, *layoutGraph); + CC_ENSURES(passLayoutID != LayoutGraphData::null_vertex()); + + const auto phaseLayoutID = locate(passLayoutID, phaseName, *layoutGraph); CC_ENSURES(phaseLayoutID != LayoutGraphData::null_vertex()); auto queueID = addVertex2( @@ -1004,7 +1023,7 @@ RenderQueueBuilder *NativeRenderPassBuilder::addQueue( std::forward_as_tuple(phaseName), std::forward_as_tuple(), std::forward_as_tuple(), - std::forward_as_tuple(hint, phaseLayoutID), + std::forward_as_tuple(hint, phaseLayoutID, passLayoutID), *renderGraph, nodeID); return new NativeRenderQueueBuilder(pipelineRuntime, renderGraph, queueID, layoutGraph, phaseLayoutID); @@ -1187,12 +1206,18 @@ void NativeMultisampleRenderPassBuilder::addStorageImage( } RenderQueueBuilder *NativeMultisampleRenderPassBuilder::addQueue( - QueueHint hint, const ccstd::string &phaseName) { + QueueHint hint, const ccstd::string &phaseName, const ccstd::string &passName) { CC_EXPECTS(!phaseName.empty()); CC_EXPECTS(subpassLayoutID == layoutID); CC_EXPECTS(subpassLayoutID != LayoutGraphData::null_vertex()); - const auto phaseLayoutID = locate(subpassLayoutID, phaseName, *layoutGraph); + const auto passLayoutID = + passName.empty() + ? layoutID + : locate(LayoutGraphData::null_vertex(), passName, *layoutGraph); + CC_ENSURES(passLayoutID != LayoutGraphData::null_vertex()); + + const auto phaseLayoutID = locate(passLayoutID, phaseName, *layoutGraph); CC_ENSURES(phaseLayoutID != LayoutGraphData::null_vertex()); auto queueID = addVertex2( @@ -1201,7 +1226,7 @@ RenderQueueBuilder *NativeMultisampleRenderPassBuilder::addQueue( std::forward_as_tuple(phaseName), std::forward_as_tuple(), std::forward_as_tuple(), - std::forward_as_tuple(hint, phaseLayoutID), + std::forward_as_tuple(hint, phaseLayoutID, passLayoutID), *renderGraph, subpassID); return new NativeRenderQueueBuilder(pipelineRuntime, renderGraph, queueID, layoutGraph, phaseLayoutID); @@ -1368,11 +1393,18 @@ void NativeComputePassBuilder::setCustomShaderStages( } } -ComputeQueueBuilder *NativeComputePassBuilder::addQueue(const ccstd::string &phaseName) { +ComputeQueueBuilder *NativeComputePassBuilder::addQueue( + const ccstd::string &phaseName, const ccstd::string &passName) { CC_EXPECTS(!phaseName.empty()); CC_EXPECTS(layoutID != LayoutGraphData::null_vertex()); - const auto phaseLayoutID = locate(layoutID, phaseName, *layoutGraph); + const auto passLayoutID = + passName.empty() + ? layoutID + : locate(LayoutGraphData::null_vertex(), passName, *layoutGraph); + CC_ENSURES(passLayoutID != LayoutGraphData::null_vertex()); + + const auto phaseLayoutID = locate(passLayoutID, phaseName, *layoutGraph); CC_ENSURES(phaseLayoutID != LayoutGraphData::null_vertex()); auto queueID = addVertex2( @@ -1381,7 +1413,7 @@ ComputeQueueBuilder *NativeComputePassBuilder::addQueue(const ccstd::string &pha std::forward_as_tuple(phaseName), std::forward_as_tuple(), std::forward_as_tuple(), - std::forward_as_tuple(QueueHint::NONE, phaseLayoutID), + std::forward_as_tuple(QueueHint::NONE, phaseLayoutID, passLayoutID), *renderGraph, nodeID); return new NativeComputeQueueBuilder(pipelineRuntime, renderGraph, queueID, layoutGraph, phaseLayoutID); diff --git a/native/cocos/renderer/pipeline/custom/RenderGraphTypes.h b/native/cocos/renderer/pipeline/custom/RenderGraphTypes.h index 3809d968745..1d3218ed142 100644 --- a/native/cocos/renderer/pipeline/custom/RenderGraphTypes.h +++ b/native/cocos/renderer/pipeline/custom/RenderGraphTypes.h @@ -857,14 +857,17 @@ struct ClearView { struct RenderQueue { RenderQueue() = default; - RenderQueue(QueueHint hintIn, uint32_t phaseIDIn) noexcept + RenderQueue(QueueHint hintIn, uint32_t phaseIDIn, uint32_t passLayoutIDIn) noexcept // NOLINT : hint(hintIn), - phaseID(phaseIDIn) {} - RenderQueue(uint32_t phaseIDIn) noexcept // NOLINT - : phaseID(phaseIDIn) {} + phaseID(phaseIDIn), + passLayoutID(passLayoutIDIn) {} + RenderQueue(uint32_t phaseIDIn, uint32_t passLayoutIDIn) noexcept + : phaseID(phaseIDIn), + passLayoutID(passLayoutIDIn) {} QueueHint hint{QueueHint::RENDER_OPAQUE}; uint32_t phaseID{0xFFFFFFFF}; + uint32_t passLayoutID{0xFFFFFFFF}; gfx::Viewport viewport; }; diff --git a/native/cocos/renderer/pipeline/custom/RenderInterfaceTypes.h b/native/cocos/renderer/pipeline/custom/RenderInterfaceTypes.h index b39cd564a7f..8d6b0f7cac8 100644 --- a/native/cocos/renderer/pipeline/custom/RenderInterfaceTypes.h +++ b/native/cocos/renderer/pipeline/custom/RenderInterfaceTypes.h @@ -723,9 +723,10 @@ class BasicRenderPassBuilder : public Setter { * * @param hint @en Usage hint of the queue @zh 用途的提示 * @param phaseName @en The name of the phase declared in the effect. Default value is 'default' @zh effect中相位(phase)的名字,缺省为'default'。 + * @param passName @en The name of the pass declared in the effect. It is used to override the pass name in the parent pass/subpass. @zh effect中通道(pass)的名字,会覆盖(override)父(通道/子通道)中已设置的pass名字。 * @returns @en render queue builder @zh 渲染队列 */ - virtual RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName) = 0; + virtual RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName, const ccstd::string &passName) = 0; /** * @en Set rendering viewport. * @zh 设置渲染视口 @@ -773,10 +774,13 @@ class BasicRenderPassBuilder : public Setter { addTexture(name, slotName, sampler, 0); } RenderQueueBuilder *addQueue() { - return addQueue(QueueHint::NONE, "default"); + return addQueue(QueueHint::NONE, "default", ""); } RenderQueueBuilder *addQueue(QueueHint hint) { - return addQueue(hint, "default"); + return addQueue(hint, "default", ""); + } + RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName) { + return addQueue(hint, phaseName, ""); } }; @@ -1205,9 +1209,10 @@ class RenderSubpassBuilder : public Setter { * * @param hint @en Usage hint of the queue @zh 用途的提示 * @param phaseName @en The name of the phase declared in the effect. Default value is 'default' @zh effect中相位(phase)的名字,缺省为'default'。 + * @param passName @en The name of the pass declared in the effect. It is used to override the pass name in the parent pass/subpass. @zh effect中通道(pass)的名字,会覆盖(override)父(通道/子通道)中已设置的pass名字。 * @returns @en render queue builder @zh 渲染队列 */ - virtual RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName) = 0; + virtual RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName, const ccstd::string &passName) = 0; /** * @en Show statistics on screen * @zh 在屏幕上渲染统计数据 @@ -1258,10 +1263,13 @@ class RenderSubpassBuilder : public Setter { addTexture(name, slotName, sampler, 0); } RenderQueueBuilder *addQueue() { - return addQueue(QueueHint::NONE, "default"); + return addQueue(QueueHint::NONE, "default", ""); } RenderQueueBuilder *addQueue(QueueHint hint) { - return addQueue(hint, "default"); + return addQueue(hint, "default", ""); + } + RenderQueueBuilder *addQueue(QueueHint hint, const ccstd::string &phaseName) { + return addQueue(hint, phaseName, ""); } }; @@ -1391,9 +1399,10 @@ class ComputeSubpassBuilder : public Setter { * * @param hint @en Usage hint of the queue @zh 用途的提示 * @param phaseName @en The name of the phase declared in the effect. Default value is 'default' @zh effect中相位(phase)的名字,缺省为'default'。 + * @param passName @en The name of the pass declared in the effect. It is used to override the pass name in the parent pass/subpass. @zh effect中通道(pass)的名字,会覆盖(override)父(通道/子通道)中已设置的pass名字。 * @returns @en compute queue builder @zh 计算队列 */ - virtual ComputeQueueBuilder *addQueue(const ccstd::string &phaseName) = 0; + virtual ComputeQueueBuilder *addQueue(const ccstd::string &phaseName, const ccstd::string &passName) = 0; /** * @experimental */ @@ -1405,7 +1414,10 @@ class ComputeSubpassBuilder : public Setter { addTexture(name, slotName, sampler, 0); } ComputeQueueBuilder *addQueue() { - return addQueue("default"); + return addQueue("default", ""); + } + ComputeQueueBuilder *addQueue(const ccstd::string &phaseName) { + return addQueue(phaseName, ""); } }; @@ -1568,9 +1580,10 @@ class ComputePassBuilder : public Setter { * * @param hint @en Usage hint of the queue @zh 用途的提示 * @param phaseName @en The name of the phase declared in the effect. Default value is 'default' @zh effect中相位(phase)的名字,缺省为'default'。 + * @param passName @en The name of the pass declared in the effect. It is used to override the pass name in the parent pass/subpass. @zh effect中通道(pass)的名字,会覆盖(override)父(通道/子通道)中已设置的pass名字。 * @returns @en compute queue builder @zh 计算队列 */ - virtual ComputeQueueBuilder *addQueue(const ccstd::string &phaseName) = 0; + virtual ComputeQueueBuilder *addQueue(const ccstd::string &phaseName, const ccstd::string &passName) = 0; /** * @experimental */ @@ -1585,7 +1598,10 @@ class ComputePassBuilder : public Setter { addMaterialTexture(resourceName, gfx::ShaderStageFlagBit::COMPUTE); } ComputeQueueBuilder *addQueue() { - return addQueue("default"); + return addQueue("default", ""); + } + ComputeQueueBuilder *addQueue(const ccstd::string &phaseName) { + return addQueue(phaseName, ""); } };