diff --git a/cocos/rendering/custom/archive.ts b/cocos/rendering/custom/archive.ts index 9b513ffc2bd..3d1ea4859c7 100644 --- a/cocos/rendering/custom/archive.ts +++ b/cocos/rendering/custom/archive.ts @@ -32,10 +32,12 @@ export interface OutputArchive { writeBool (value: boolean): void; writeNumber (value: number): void; writeString (value: string): void; + _pool?: boolean; } export interface InputArchive { readBool (): boolean; readNumber (): number; readString (): string; + _pool?: boolean; } diff --git a/cocos/rendering/custom/layout-graph.ts b/cocos/rendering/custom/layout-graph.ts index 3accaa29592..b50bc99c0a1 100644 --- a/cocos/rendering/custom/layout-graph.ts +++ b/cocos/rendering/custom/layout-graph.ts @@ -40,6 +40,7 @@ export class DescriptorDB { this.blocks.clear(); } readonly blocks: Map = new Map(); + _pool?: boolean; } export class RenderPhase { @@ -47,6 +48,7 @@ export class RenderPhase { this.shaders.clear(); } readonly shaders: Set = new Set(); + _pool?: boolean; } export enum RenderPassType { @@ -586,6 +588,7 @@ export class LayoutGraph implements BidirectionalGraph readonly _vertices: LayoutGraphVertex[] = []; readonly _names: string[] = []; readonly _descriptors: DescriptorDB[] = []; + _pool?: boolean; } export class UniformData { @@ -604,6 +607,7 @@ export class UniformData { uniformType: Type; offset: number; size = 0; + _pool?: boolean; } export class UniformBlockData { @@ -613,6 +617,7 @@ export class UniformBlockData { } bufferSize = 0; readonly uniforms: UniformData[] = []; + _pool?: boolean; } export class DescriptorData { @@ -629,6 +634,7 @@ export class DescriptorData { descriptorID: number; type: Type; count: number; + _pool?: boolean; } export class DescriptorBlockData { @@ -649,6 +655,7 @@ export class DescriptorBlockData { offset = 0; capacity: number; readonly descriptors: DescriptorData[] = []; + _pool?: boolean; } export class DescriptorSetLayoutData { @@ -684,6 +691,7 @@ export class DescriptorSetLayoutData { readonly descriptorBlocks: DescriptorBlockData[]; readonly uniformBlocks: Map; readonly bindingMap: Map; + _pool?: boolean; } export class DescriptorSetData { @@ -702,6 +710,7 @@ export class DescriptorSetData { readonly descriptorSetLayoutInfo: DescriptorSetLayoutInfo = new DescriptorSetLayoutInfo(); /*refcount*/ descriptorSetLayout: DescriptorSetLayout | null; /*refcount*/ descriptorSet: DescriptorSet | null; + _pool?: boolean; } export class PipelineLayoutData { @@ -709,6 +718,7 @@ export class PipelineLayoutData { this.descriptorSets.clear(); } readonly descriptorSets: Map = new Map(); + _pool?: boolean; } export class ShaderBindingData { @@ -716,6 +726,7 @@ export class ShaderBindingData { this.descriptorBindings.clear(); } readonly descriptorBindings: Map = new Map(); + _pool?: boolean; } export class ShaderLayoutData { @@ -725,6 +736,7 @@ export class ShaderLayoutData { } readonly layoutData: Map = new Map(); readonly bindingData: Map = new Map(); + _pool?: boolean; } export class TechniqueData { @@ -732,6 +744,7 @@ export class TechniqueData { this.passes.length = 0; } readonly passes: ShaderLayoutData[] = []; + _pool?: boolean; } export class EffectData { @@ -739,6 +752,7 @@ export class EffectData { this.techniques.clear(); } readonly techniques: Map = new Map(); + _pool?: boolean; } export class ShaderProgramData { @@ -748,6 +762,7 @@ export class ShaderProgramData { } readonly layout: PipelineLayoutData = new PipelineLayoutData(); /*refcount*/ pipelineLayout: PipelineLayout | null = null; + _pool?: boolean; } export class RenderStageData { @@ -755,6 +770,7 @@ export class RenderStageData { this.descriptorVisibility.clear(); } readonly descriptorVisibility: Map = new Map(); + _pool?: boolean; } export class RenderPhaseData { @@ -768,6 +784,7 @@ export class RenderPhaseData { readonly shaderPrograms: ShaderProgramData[] = []; readonly shaderIndex: Map = new Map(); /*refcount*/ pipelineLayout: PipelineLayout | null = null; + _pool?: boolean; } //================================================================= @@ -1334,6 +1351,7 @@ export class LayoutGraphData implements BidirectionalGraph readonly shaderLayoutIndex: Map = new Map(); readonly effects: Map = new Map(); constantMacros = ''; + _pool?: boolean; } export class LayoutGraphObjectPoolSettings { @@ -1425,6 +1443,7 @@ export class LayoutGraphObjectPool { v = new DescriptorDB(); } else { v = this._descriptorDB.add(); + v._pool = true; } v.reset(); return v; @@ -1435,6 +1454,7 @@ export class LayoutGraphObjectPool { v = new RenderPhase(); } else { v = this._renderPhase.add(); + v._pool = true; } v.reset(); return v; @@ -1445,6 +1465,7 @@ export class LayoutGraphObjectPool { v = new LayoutGraph(); } else { v = this._layoutGraph.add(); + v._pool = true; } v.clear(); return v; @@ -1459,6 +1480,7 @@ export class LayoutGraphObjectPool { v = new UniformData(); } else { v = this._uniformData.add(); + v._pool = true; } v.reset(uniformID, uniformType, offset); return v; @@ -1469,6 +1491,7 @@ export class LayoutGraphObjectPool { v = new UniformBlockData(); } else { v = this._uniformBlockData.add(); + v._pool = true; } v.reset(); return v; @@ -1483,6 +1506,7 @@ export class LayoutGraphObjectPool { v = new DescriptorData(); } else { v = this._descriptorData.add(); + v._pool = true; } v.reset(descriptorID, type, count); return v; @@ -1497,6 +1521,7 @@ export class LayoutGraphObjectPool { v = new DescriptorBlockData(); } else { v = this._descriptorBlockData.add(); + v._pool = true; } v.reset(type, visibility, capacity); return v; @@ -1510,6 +1535,7 @@ export class LayoutGraphObjectPool { v = new DescriptorSetLayoutData(); } else { v = this._descriptorSetLayoutData.add(); + v._pool = true; } v.reset(slot, capacity); return v; @@ -1523,6 +1549,7 @@ export class LayoutGraphObjectPool { v = new DescriptorSetData(); } else { v = this._descriptorSetData.add(); + v._pool = true; } v.reset(descriptorSetLayout, descriptorSet); return v; @@ -1533,6 +1560,7 @@ export class LayoutGraphObjectPool { v = new PipelineLayoutData(); } else { v = this._pipelineLayoutData.add(); + v._pool = true; } v.reset(); return v; @@ -1543,6 +1571,7 @@ export class LayoutGraphObjectPool { v = new ShaderBindingData(); } else { v = this._shaderBindingData.add(); + v._pool = true; } v.reset(); return v; @@ -1553,6 +1582,7 @@ export class LayoutGraphObjectPool { v = new ShaderLayoutData(); } else { v = this._shaderLayoutData.add(); + v._pool = true; } v.reset(); return v; @@ -1563,6 +1593,7 @@ export class LayoutGraphObjectPool { v = new TechniqueData(); } else { v = this._techniqueData.add(); + v._pool = true; } v.reset(); return v; @@ -1573,6 +1604,7 @@ export class LayoutGraphObjectPool { v = new EffectData(); } else { v = this._effectData.add(); + v._pool = true; } v.reset(); return v; @@ -1583,6 +1615,7 @@ export class LayoutGraphObjectPool { v = new ShaderProgramData(); } else { v = this._shaderProgramData.add(); + v._pool = true; } v.reset(); return v; @@ -1593,6 +1626,7 @@ export class LayoutGraphObjectPool { v = new RenderStageData(); } else { v = this._renderStageData.add(); + v._pool = true; } v.reset(); return v; @@ -1603,6 +1637,7 @@ export class LayoutGraphObjectPool { v = new RenderPhaseData(); } else { v = this._renderPhaseData.add(); + v._pool = true; } v.reset(); return v; @@ -1613,6 +1648,7 @@ export class LayoutGraphObjectPool { v = new LayoutGraphData(); } else { v = this._layoutGraphData.add(); + v._pool = true; } v.clear(); return v; diff --git a/cocos/rendering/custom/pipeline.ts b/cocos/rendering/custom/pipeline.ts index e97d787ff1f..0dcb547d86a 100644 --- a/cocos/rendering/custom/pipeline.ts +++ b/cocos/rendering/custom/pipeline.ts @@ -179,6 +179,7 @@ export interface PipelineRuntime { * @zh 触发管线状态更新事件 */ onGlobalPipelineStateChanged (): void; + _pool?: boolean; } /** @@ -268,6 +269,7 @@ export enum SubpassCapabilities { */ export class PipelineCapabilities { subpass: SubpassCapabilities = SubpassCapabilities.NONE; + _pool?: boolean; } /** @@ -286,6 +288,7 @@ export interface RenderNode { * @experimental */ setCustomBehavior (name: string): void; + _pool?: boolean; } /** @@ -390,6 +393,7 @@ export interface Setter extends RenderNode { light: DirectionalLight, csmLevel?: number): void; setBuiltinSpotLightFrustumConstants (light: SpotLight): void; + _pool?: boolean; } export interface SceneBuilder extends Setter { @@ -397,6 +401,7 @@ export interface SceneBuilder extends Setter { light: Light, csmLevel?: number, optCamera?: Camera): void; + _pool?: boolean; } /** @@ -465,6 +470,7 @@ export interface RenderQueueBuilder extends Setter { * @experimental */ addCustomCommand (customBehavior: string): void; + _pool?: boolean; } /** @@ -559,6 +565,7 @@ export interface BasicRenderPassBuilder extends Setter { * @zh 在屏幕上渲染统计数据 */ showStatistics: boolean; + _pool?: boolean; } export interface BasicMultisampleRenderPassBuilder extends BasicRenderPassBuilder { @@ -568,6 +575,7 @@ export interface BasicMultisampleRenderPassBuilder extends BasicRenderPassBuilde target: string, depthMode?: ResolveMode, stencilMode?: ResolveMode): void; + _pool?: boolean; } /** @@ -816,6 +824,7 @@ export interface BasicPipeline extends PipelineRuntime { * @engineInternal */ getDescriptorSetLayout (shaderName: string, freq: UpdateFrequency): DescriptorSetLayout | undefined; + _pool?: boolean; } /** @@ -945,6 +954,7 @@ export interface RenderSubpassBuilder extends Setter { * @experimental */ setCustomShaderStages (name: string, stageFlags: ShaderStageFlagBit): void; + _pool?: boolean; } /** @@ -973,6 +983,7 @@ export interface MultisampleRenderSubpassBuilder extends RenderSubpassBuilder { target: string, depthMode?: ResolveMode, stencilMode?: ResolveMode): void; + _pool?: boolean; } /** @@ -995,6 +1006,7 @@ export interface ComputeQueueBuilder extends Setter { threadGroupCountZ: number, material?: Material, passID?: number): void; + _pool?: boolean; } /** @@ -1078,6 +1090,7 @@ export interface ComputeSubpassBuilder extends Setter { * @experimental */ setCustomShaderStages (name: string, stageFlags: ShaderStageFlagBit): void; + _pool?: boolean; } /** @@ -1148,6 +1161,7 @@ export interface RenderPassBuilder extends BasicRenderPassBuilder { * @experimental */ setCustomShaderStages (name: string, stageFlags: ShaderStageFlagBit): void; + _pool?: boolean; } export interface MultisampleRenderPassBuilder extends BasicMultisampleRenderPassBuilder { @@ -1159,6 +1173,7 @@ export interface MultisampleRenderPassBuilder extends BasicMultisampleRenderPass name: string, accessType: AccessType, slotName: string): void; + _pool?: boolean; } /** @@ -1238,6 +1253,7 @@ export interface ComputePassBuilder extends Setter { * @experimental */ setCustomShaderStages (name: string, stageFlags: ShaderStageFlagBit): void; + _pool?: boolean; } /** @@ -1408,6 +1424,7 @@ export interface Pipeline extends BasicPipeline { name: string, info: TextureInfo, type: string): number; + _pool?: boolean; } /** @@ -1427,6 +1444,7 @@ export interface PipelineBuilder { */ setup (cameras: Camera[], pipeline: BasicPipeline): void; onGlobalPipelineStateChanged? (): void; + _pool?: boolean; } /** @@ -1436,4 +1454,5 @@ export interface RenderingModule { getPassID (name: string): number; getSubpassID (passID: number, name: string): number; getPhaseID (subpassOrPassID: number, name: string): number; + _pool?: boolean; } diff --git a/cocos/rendering/custom/private.ts b/cocos/rendering/custom/private.ts index b4cae1f5d17..13566b9c74b 100644 --- a/cocos/rendering/custom/private.ts +++ b/cocos/rendering/custom/private.ts @@ -36,6 +36,7 @@ import { IProgramInfo } from '../../render-scene/core/program-lib'; export interface ProgramProxy { readonly name: string; readonly shader: Shader; + _pool?: boolean; } export interface ProgramLibrary { @@ -70,4 +71,5 @@ export interface ProgramLibrary { getProgramID (phaseID: number, programName: string): number; getDescriptorNameID (name: string): number; getDescriptorName (nameID: number): string; + _pool?: boolean; } diff --git a/cocos/rendering/custom/render-graph.ts b/cocos/rendering/custom/render-graph.ts index abf231b2ab9..8cfd6d5e5a3 100644 --- a/cocos/rendering/custom/render-graph.ts +++ b/cocos/rendering/custom/render-graph.ts @@ -55,6 +55,7 @@ export class ClearValue { y: number; z: number; w: number; + _pool?: boolean; } export class RasterView { @@ -107,6 +108,7 @@ export class RasterView { readonly clearColor: Color; slotID = 0; shaderStageFlags: ShaderStageFlagBit; + _pool?: boolean; } export class ComputeView { @@ -147,6 +149,7 @@ export class ComputeView { clearValueType: ClearValueType; readonly clearValue: ClearValue; shaderStageFlags: ShaderStageFlagBit; + _pool?: boolean; } export class ResourceDesc { @@ -174,6 +177,7 @@ export class ResourceDesc { textureFlags: TextureFlagBit = TextureFlagBit.NONE; flags: ResourceFlags = ResourceFlags.NONE; viewType: TextureType = TextureType.TEX2D; + _pool?: boolean; } export class ResourceTraits { @@ -184,6 +188,7 @@ export class ResourceTraits { this.residency = residency; } residency: ResourceResidency; + _pool?: boolean; } export class RenderSwapchain { @@ -202,6 +207,7 @@ export class RenderSwapchain { currentID = 0; numBackBuffers = 0; generation = 0xFFFFFFFF; + _pool?: boolean; } export class ResourceStates { @@ -209,6 +215,7 @@ export class ResourceStates { this.states = AccessFlagBit.NONE; } states: AccessFlagBit = AccessFlagBit.NONE; + _pool?: boolean; } export class ManagedBuffer { @@ -221,6 +228,7 @@ export class ManagedBuffer { } /*refcount*/ buffer: Buffer | null; fenceValue = 0; + _pool?: boolean; } export class PersistentBuffer { @@ -233,6 +241,7 @@ export class PersistentBuffer { } /*refcount*/ buffer: Buffer | null; fenceValue = 0; + _pool?: boolean; } export class ManagedTexture { @@ -245,6 +254,7 @@ export class ManagedTexture { } /*refcount*/ texture: Texture | null; fenceValue = 0; + _pool?: boolean; } export class PersistentTexture { @@ -257,6 +267,7 @@ export class PersistentTexture { } /*refcount*/ texture: Texture | null; fenceValue = 0; + _pool?: boolean; } export class ManagedResource { @@ -264,6 +275,7 @@ export class ManagedResource { this.unused = 0; } unused = 0; + _pool?: boolean; } export class Subpass { @@ -275,6 +287,7 @@ export class Subpass { readonly rasterViews: Map = new Map(); readonly computeViews: Map = new Map(); readonly resolvePairs: ResolvePair[] = []; + _pool?: boolean; } //================================================================= @@ -576,6 +589,7 @@ export class SubpassGraph implements BidirectionalGraph readonly _vertices: SubpassGraphVertex[] = []; readonly _names: string[] = []; readonly _subpasses: Subpass[] = []; + _pool?: boolean; } export class RasterSubpass { @@ -602,6 +616,7 @@ export class RasterSubpass { count: number; quality: number; showStatistics = false; + _pool?: boolean; } export class ComputeSubpass { @@ -616,6 +631,7 @@ export class ComputeSubpass { readonly rasterViews: Map = new Map(); readonly computeViews: Map = new Map(); subpassID: number; + _pool?: boolean; } export class RasterPass { @@ -649,6 +665,7 @@ export class RasterPass { version = 0; hashValue = 0; showStatistics = false; + _pool?: boolean; } export class PersistentRenderPassAndFramebuffer { @@ -668,6 +685,7 @@ export class PersistentRenderPassAndFramebuffer { readonly clearColors: Color[] = []; clearDepth = 0; clearStencil = 0; + _pool?: boolean; } export class FormatView { @@ -675,6 +693,7 @@ export class FormatView { this.format = Format.UNKNOWN; } format: Format = Format.UNKNOWN; + _pool?: boolean; } export class SubresourceView { @@ -696,6 +715,7 @@ export class SubresourceView { numArraySlices = 0; firstPlane = 0; numPlanes = 0; + _pool?: boolean; } //================================================================= @@ -1447,6 +1467,7 @@ export class ResourceGraph implements BidirectionalGraph readonly renderPasses: Map = new Map(); nextFenceValue = 0; version = 0; + _pool?: boolean; } export class ComputePass { @@ -1456,6 +1477,7 @@ export class ComputePass { } readonly computeViews: Map = new Map(); readonly textures: Map = new Map(); + _pool?: boolean; } export class ResolvePass { @@ -1463,6 +1485,7 @@ export class ResolvePass { this.resolvePairs.length = 0; } readonly resolvePairs: ResolvePair[] = []; + _pool?: boolean; } export class CopyPass { @@ -1472,6 +1495,7 @@ export class CopyPass { } readonly copyPairs: CopyPair[] = []; readonly uploadPairs: UploadPair[] = []; + _pool?: boolean; } export class MovePass { @@ -1479,6 +1503,7 @@ export class MovePass { this.movePairs.length = 0; } readonly movePairs: MovePair[] = []; + _pool?: boolean; } export class RaytracePass { @@ -1486,6 +1511,7 @@ export class RaytracePass { this.computeViews.clear(); } readonly computeViews: Map = new Map(); + _pool?: boolean; } export class ClearView { @@ -1502,6 +1528,7 @@ export class ClearView { slotName: string; clearFlags: ClearFlagBit; readonly clearColor: Color; + _pool?: boolean; } export class RenderQueue { @@ -1517,6 +1544,7 @@ export class RenderQueue { hint: QueueHint; phaseID: number; viewport: Viewport | null = null; + _pool?: boolean; } export enum CullingFlags { @@ -1562,6 +1590,7 @@ export class SceneData { flags: SceneFlags; cullingFlags: CullingFlags; /*refcount*/ shadingLight: Light | null; + _pool?: boolean; } export class Dispatch { @@ -1596,6 +1625,7 @@ export class Dispatch { threadGroupCountX: number; threadGroupCountY: number; threadGroupCountZ: number; + _pool?: boolean; } export class Blit { @@ -1615,6 +1645,7 @@ export class Blit { passID: number; sceneFlags: SceneFlags; /*pointer*/ camera: Camera | null; + _pool?: boolean; } export class RenderData { @@ -1630,6 +1661,7 @@ export class RenderData { readonly textures: Map = new Map(); readonly samplers: Map = new Map(); custom = ''; + _pool?: boolean; } //================================================================= @@ -2514,6 +2546,7 @@ export class RenderGraph implements BidirectionalGraph readonly _valid: boolean[] = []; readonly index: Map = new Map(); readonly sortedVertices: number[] = []; + _pool?: boolean; } export class RenderGraphObjectPoolSettings { @@ -2670,6 +2703,7 @@ export class RenderGraphObjectPool { v = new ClearValue(); } else { v = this._clearValue.add(); + v._pool = true; } v.reset(x, y, z, w); return v; @@ -2688,6 +2722,7 @@ export class RenderGraphObjectPool { v = new RasterView(); } else { v = this._rasterView.add(); + v._pool = true; } v.reset(slotName, accessType, attachmentType, loadOp, storeOp, clearFlags, shaderStageFlags); return v; @@ -2704,6 +2739,7 @@ export class RenderGraphObjectPool { v = new ComputeView(); } else { v = this._computeView.add(); + v._pool = true; } v.reset(name, accessType, clearFlags, clearValueType, shaderStageFlags); return v; @@ -2714,6 +2750,7 @@ export class RenderGraphObjectPool { v = new ResourceDesc(); } else { v = this._resourceDesc.add(); + v._pool = true; } v.reset(); return v; @@ -2726,6 +2763,7 @@ export class RenderGraphObjectPool { v = new ResourceTraits(); } else { v = this._resourceTraits.add(); + v._pool = true; } v.reset(residency); return v; @@ -2738,6 +2776,7 @@ export class RenderGraphObjectPool { v = new RenderSwapchain(); } else { v = this._renderSwapchain.add(); + v._pool = true; } v.reset(swapchain); return v; @@ -2748,6 +2787,7 @@ export class RenderGraphObjectPool { v = new ResourceStates(); } else { v = this._resourceStates.add(); + v._pool = true; } v.reset(); return v; @@ -2760,6 +2800,7 @@ export class RenderGraphObjectPool { v = new ManagedBuffer(); } else { v = this._managedBuffer.add(); + v._pool = true; } v.reset(buffer); return v; @@ -2772,6 +2813,7 @@ export class RenderGraphObjectPool { v = new PersistentBuffer(); } else { v = this._persistentBuffer.add(); + v._pool = true; } v.reset(buffer); return v; @@ -2784,6 +2826,7 @@ export class RenderGraphObjectPool { v = new ManagedTexture(); } else { v = this._managedTexture.add(); + v._pool = true; } v.reset(texture); return v; @@ -2796,6 +2839,7 @@ export class RenderGraphObjectPool { v = new PersistentTexture(); } else { v = this._persistentTexture.add(); + v._pool = true; } v.reset(texture); return v; @@ -2806,6 +2850,7 @@ export class RenderGraphObjectPool { v = new ManagedResource(); } else { v = this._managedResource.add(); + v._pool = true; } v.reset(); return v; @@ -2816,6 +2861,7 @@ export class RenderGraphObjectPool { v = new Subpass(); } else { v = this._subpass.add(); + v._pool = true; } v.reset(); return v; @@ -2826,6 +2872,7 @@ export class RenderGraphObjectPool { v = new SubpassGraph(); } else { v = this._subpassGraph.add(); + v._pool = true; } v.clear(); return v; @@ -2840,6 +2887,7 @@ export class RenderGraphObjectPool { v = new RasterSubpass(); } else { v = this._rasterSubpass.add(); + v._pool = true; } v.reset(subpassID, count, quality); return v; @@ -2852,6 +2900,7 @@ export class RenderGraphObjectPool { v = new ComputeSubpass(); } else { v = this._computeSubpass.add(); + v._pool = true; } v.reset(subpassID); return v; @@ -2862,6 +2911,7 @@ export class RenderGraphObjectPool { v = new RasterPass(); } else { v = this._rasterPass.add(); + v._pool = true; } v.reset(); return v; @@ -2875,6 +2925,7 @@ export class RenderGraphObjectPool { v = new PersistentRenderPassAndFramebuffer(); } else { v = this._persistentRenderPassAndFramebuffer.add(); + v._pool = true; } v.reset(renderPass, framebuffer); return v; @@ -2885,6 +2936,7 @@ export class RenderGraphObjectPool { v = new FormatView(); } else { v = this._formatView.add(); + v._pool = true; } v.reset(); return v; @@ -2895,6 +2947,7 @@ export class RenderGraphObjectPool { v = new SubresourceView(); } else { v = this._subresourceView.add(); + v._pool = true; } v.reset(); return v; @@ -2905,6 +2958,7 @@ export class RenderGraphObjectPool { v = new ResourceGraph(); } else { v = this._resourceGraph.add(); + v._pool = true; } v.clear(); return v; @@ -2915,6 +2969,7 @@ export class RenderGraphObjectPool { v = new ComputePass(); } else { v = this._computePass.add(); + v._pool = true; } v.reset(); return v; @@ -2925,6 +2980,7 @@ export class RenderGraphObjectPool { v = new ResolvePass(); } else { v = this._resolvePass.add(); + v._pool = true; } v.reset(); return v; @@ -2935,6 +2991,7 @@ export class RenderGraphObjectPool { v = new CopyPass(); } else { v = this._copyPass.add(); + v._pool = true; } v.reset(); return v; @@ -2945,6 +3002,7 @@ export class RenderGraphObjectPool { v = new MovePass(); } else { v = this._movePass.add(); + v._pool = true; } v.reset(); return v; @@ -2955,6 +3013,7 @@ export class RenderGraphObjectPool { v = new RaytracePass(); } else { v = this._raytracePass.add(); + v._pool = true; } v.reset(); return v; @@ -2968,6 +3027,7 @@ export class RenderGraphObjectPool { v = new ClearView(); } else { v = this._clearView.add(); + v._pool = true; } v.reset(slotName, clearFlags); return v; @@ -2981,6 +3041,7 @@ export class RenderGraphObjectPool { v = new RenderQueue(); } else { v = this._renderQueue.add(); + v._pool = true; } v.reset(hint, phaseID); return v; @@ -2997,6 +3058,7 @@ export class RenderGraphObjectPool { v = new SceneData(); } else { v = this._sceneData.add(); + v._pool = true; } v.reset(scene, camera, flags, cullingFlags, shadingLight); return v; @@ -3013,6 +3075,7 @@ export class RenderGraphObjectPool { v = new Dispatch(); } else { v = this._dispatch.add(); + v._pool = true; } v.reset(material, passID, threadGroupCountX, threadGroupCountY, threadGroupCountZ); return v; @@ -3028,6 +3091,7 @@ export class RenderGraphObjectPool { v = new Blit(); } else { v = this._blit.add(); + v._pool = true; } v.reset(material, passID, sceneFlags, camera); return v; @@ -3038,6 +3102,7 @@ export class RenderGraphObjectPool { v = new RenderData(); } else { v = this._renderData.add(); + v._pool = true; } v.reset(); return v; @@ -3048,6 +3113,7 @@ export class RenderGraphObjectPool { v = new RenderGraph(); } else { v = this._renderGraph.add(); + v._pool = true; } v.clear(); return v; diff --git a/cocos/rendering/custom/types.ts b/cocos/rendering/custom/types.ts index f098a245129..21d307d1d42 100644 --- a/cocos/rendering/custom/types.ts +++ b/cocos/rendering/custom/types.ts @@ -307,6 +307,7 @@ export class LightInfo { /*pointer*/ probe: ReflectionProbe | null; level: number; culledByLight: boolean; + _pool?: boolean; } export enum DescriptorTypeOrder { @@ -356,6 +357,7 @@ export class Descriptor { } type: Type; count = 1; + _pool?: boolean; } export class DescriptorBlock { @@ -369,6 +371,7 @@ export class DescriptorBlock { readonly uniformBlocks: Map = new Map(); capacity = 0; count = 0; + _pool?: boolean; } export class DescriptorBlockFlattened { @@ -386,6 +389,7 @@ export class DescriptorBlockFlattened { readonly uniformBlocks: UniformBlock[] = []; capacity = 0; count = 0; + _pool?: boolean; } export class DescriptorBlockIndex { @@ -399,6 +403,7 @@ export class DescriptorBlockIndex { parameterType: ParameterType; descriptorType: DescriptorTypeOrder; visibility: ShaderStageFlagBit; + _pool?: boolean; } export enum ResolveFlags { @@ -440,6 +445,7 @@ export class ResolvePair { resolveFlags: ResolveFlags; mode: ResolveMode; mode1: ResolveMode; + _pool?: boolean; } export class CopyPair { @@ -499,6 +505,7 @@ export class CopyPair { targetMostDetailedMip: number; targetFirstSlice: number; targetPlaneSlice: number; + _pool?: boolean; } export class UploadPair { @@ -542,6 +549,7 @@ export class UploadPair { targetMostDetailedMip: number; targetFirstSlice: number; targetPlaneSlice: number; + _pool?: boolean; } export class MovePair { @@ -586,6 +594,7 @@ export class MovePair { targetMostDetailedMip: number; targetFirstSlice: number; targetPlaneSlice: number; + _pool?: boolean; } export class PipelineStatistics { @@ -613,6 +622,7 @@ export class PipelineStatistics { numFreeDescriptorSets = 0; numInstancingBuffers = 0; numInstancingUniformBlocks = 0; + _pool?: boolean; } export class RenderCommonObjectPoolSettings { @@ -676,6 +686,7 @@ export class RenderCommonObjectPool { v = new LightInfo(); } else { v = this._lightInfo.add(); + v._pool = true; } v.reset(light, level, culledByLight, probe); return v; @@ -688,6 +699,7 @@ export class RenderCommonObjectPool { v = new Descriptor(); } else { v = this._descriptor.add(); + v._pool = true; } v.reset(type); return v; @@ -698,6 +710,7 @@ export class RenderCommonObjectPool { v = new DescriptorBlock(); } else { v = this._descriptorBlock.add(); + v._pool = true; } v.reset(); return v; @@ -708,6 +721,7 @@ export class RenderCommonObjectPool { v = new DescriptorBlockFlattened(); } else { v = this._descriptorBlockFlattened.add(); + v._pool = true; } v.reset(); return v; @@ -723,6 +737,7 @@ export class RenderCommonObjectPool { v = new DescriptorBlockIndex(); } else { v = this._descriptorBlockIndex.add(); + v._pool = true; } v.updateFrequency = updateFrequency; v.parameterType = parameterType; @@ -742,6 +757,7 @@ export class RenderCommonObjectPool { v = new ResolvePair(); } else { v = this._resolvePair.add(); + v._pool = true; } v.reset(source, target, resolveFlags, mode, mode1); return v; @@ -763,6 +779,7 @@ export class RenderCommonObjectPool { v = new CopyPair(); } else { v = this._copyPair.add(); + v._pool = true; } v.reset(source, target, mipLevels, numSlices, sourceMostDetailedMip, sourceFirstSlice, sourcePlaneSlice, targetMostDetailedMip, targetFirstSlice, targetPlaneSlice); return v; @@ -780,6 +797,7 @@ export class RenderCommonObjectPool { v = new UploadPair(); } else { v = this._uploadPair.add(); + v._pool = true; } v.reset(target, mipLevels, numSlices, targetMostDetailedMip, targetFirstSlice, targetPlaneSlice); return v; @@ -798,6 +816,7 @@ export class RenderCommonObjectPool { v = new MovePair(); } else { v = this._movePair.add(); + v._pool = true; } v.reset(source, target, mipLevels, numSlices, targetMostDetailedMip, targetFirstSlice, targetPlaneSlice); return v; @@ -808,6 +827,7 @@ export class RenderCommonObjectPool { v = new PipelineStatistics(); } else { v = this._pipelineStatistics.add(); + v._pool = true; } v.reset(); return v; diff --git a/cocos/rendering/custom/web-types.ts b/cocos/rendering/custom/web-types.ts index b275b9abde9..1760987eb42 100644 --- a/cocos/rendering/custom/web-types.ts +++ b/cocos/rendering/custom/web-types.ts @@ -51,9 +51,11 @@ export class ProgramInfo { readonly attributes: Attribute[]; readonly blockSizes: number[]; readonly handleMap: Record; + _pool?: boolean; } export class ProgramGroup { readonly programInfos: Map = new Map(); readonly programProxies: Map = new Map(); + _pool?: boolean; }