@babylonjs/core 8.29.2 → 8.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.js +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.d.ts +2 -1
- package/FrameGraph/Node/nodeRenderGraph.js +8 -8
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Passes/renderPass.js +3 -3
- package/FrameGraph/Passes/renderPass.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +7 -7
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +4 -0
- package/FrameGraph/frameGraph.js +8 -0
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +2 -1
- package/FrameGraph/frameGraphRenderContext.js +10 -3
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.d.ts +32 -6
- package/FrameGraph/frameGraphTextureManager.js +138 -14
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/Misc/screenshotTools.d.ts +63 -1
- package/Misc/screenshotTools.js +207 -4
- package/Misc/screenshotTools.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frameGraphTextureManager.js","sourceRoot":"","sources":["../../../../dev/core/src/FrameGraph/frameGraphTextureManager.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACjH,OAAO,EAAE,OAAO,EAAE,MAAM,+BA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AC;oBAC9C,KAAK,SAAS,CAAC,0BAA0B;wBACrC,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;oBAC9C;wBACI,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;gBAClD,CAAC;QACT,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAC9C,CAAC;;AA/+Bc,iCAAQ,GAAG,CAAC,AAAJ,CAAK,CAAC,+CAA+C","sourcesContent":["import type {\r\n Scene,\r\n AbstractEngine,\r\n TextureSize,\r\n Nullable,\r\n FrameGraphTextureCreationOptions,\r\n FrameGraphTextureHandle,\r\n InternalTextureCreationOptions,\r\n InternalTexture,\r\n FrameGraphTextureOptions,\r\n FrameGraphTextureDescription,\r\n RenderTargetWrapper,\r\n FrameGraphTask,\r\n IFrameGraphPass,\r\n} from \"core/index\";\r\nimport { getDimensionsFromTextureSize, textureSizeIsObject } from \"../Materials/Textures/textureCreationOptions\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { backbufferColorTextureHandle, backbufferDepthStencilTextureHandle } from \"./frameGraphTypes\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { InternalTextureSource } from \"../Materials/Textures/internalTexture\";\r\nimport { FrameGraphRenderTarget } from \"./frameGraphRenderTarget\";\r\nimport { FrameGraphRenderPass } from \"./Passes/renderPass\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { GetTypeForDepthTexture, IsDepthTexture, HasStencilAspect } from \"core/Materials/Textures/textureHelper.functions\";\r\n\r\ntype HistoryTexture = {\r\n textures: Array<Nullable<InternalTexture>>;\r\n handles: Array<FrameGraphTextureHandle>;\r\n index: number; // current index in textures array\r\n references: Array<{ renderTargetWrapper: RenderTargetWrapper; textureIndex: number }>; // render target wrappers that reference this history texture\r\n};\r\n\r\ntype TextureLifespan = {\r\n firstTask: number;\r\n lastTask: number;\r\n};\r\n\r\ntype TextureEntry = {\r\n texture: Nullable<InternalTexture>;\r\n name: string;\r\n creationOptions: FrameGraphTextureCreationOptions; // in TextureEntry, creationOptions.size is always an object\r\n namespace: FrameGraphTextureNamespace;\r\n textureIndex?: number; // Index of the texture in the types, formats, etc array of FrameGraphTextureOptions (default: 0)\r\n debug?: Texture;\r\n refHandle?: FrameGraphTextureHandle; // Handle of the texture this one is referencing - used for dangling handles\r\n textureDescriptionHash?: string; // a hash of the texture creation options\r\n lifespan?: TextureLifespan;\r\n aliasHandle?: FrameGraphTextureHandle; // Handle of the texture this one is aliasing - can be set after execution of texture allocation optimization\r\n};\r\n\r\nenum FrameGraphTextureNamespace {\r\n Task,\r\n Graph,\r\n External,\r\n}\r\n\r\n/**\r\n * Manages the textures used by a frame graph\r\n * @experimental\r\n */\r\nexport class FrameGraphTextureManager {\r\n private static _Counter = 2; // 0 and 1 are reserved for backbuffer textures\r\n\r\n /** @internal */\r\n public readonly _textures: Map<FrameGraphTextureHandle, TextureEntry> = new Map();\r\n\r\n /** @internal */\r\n public readonly _historyTextures: Map<FrameGraphTextureHandle, HistoryTexture> = new Map();\r\n\r\n /** @internal */\r\n public _isRecordingTask = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if debug logs should be shown when applying texture allocation optimization (default: false)\r\n */\r\n public showDebugLogsForTextureAllcationOptimization = false;\r\n\r\n /** If provided (greater than 0), forces the output screen width for percentage-based textures. If not provided (0), engine.getRenderWidth() will be used */\r\n public forcedOutputScreenWidth = 0;\r\n\r\n /** If provided (greater than 0), forces the output screen height for percentage-based textures. If not provided (0), engine.getRenderHeight() will be used */\r\n public forcedOutputScreenHeight = 0;\r\n\r\n /**\r\n * Constructs a new instance of the texture manager\r\n * @param engine The engine to use\r\n * @param _debugTextures If true, debug textures will be created so that they are visible in the inspector\r\n * @param _scene The scene the manager belongs to\r\n */\r\n constructor(\r\n public readonly engine: AbstractEngine,\r\n private readonly _debugTextures = false,\r\n private readonly _scene: Scene\r\n ) {\r\n this._addSystemTextures();\r\n }\r\n\r\n /**\r\n * Checks if a handle is a backbuffer handle (color or depth/stencil)\r\n * @param handle The handle to check\r\n * @returns True if the handle is a backbuffer handle\r\n */\r\n public isBackbuffer(handle: FrameGraphTextureHandle): boolean {\r\n if (handle === backbufferColorTextureHandle || handle === backbufferDepthStencilTextureHandle) {\r\n return true;\r\n }\r\n\r\n const textureEntry = this._textures.get(handle);\r\n if (!textureEntry) {\r\n return false;\r\n }\r\n\r\n return textureEntry.refHandle === backbufferColorTextureHandle || textureEntry.refHandle === backbufferDepthStencilTextureHandle;\r\n }\r\n\r\n /**\r\n * Checks if a handle is a backbuffer color handle\r\n * @param handle The handle to check\r\n * @returns True if the handle is a backbuffer color handle\r\n */\r\n public isBackbufferColor(handle: FrameGraphTextureHandle): boolean {\r\n if (handle === backbufferColorTextureHandle) {\r\n return true;\r\n }\r\n\r\n const textureEntry = this._textures.get(handle);\r\n if (!textureEntry) {\r\n return false;\r\n }\r\n\r\n return textureEntry.refHandle === backbufferColorTextureHandle;\r\n }\r\n\r\n /**\r\n * Checks if a handle is a backbuffer depth/stencil handle\r\n * @param handle The handle to check\r\n * @returns True if the handle is a backbuffer depth/stencil handle\r\n */\r\n public isBackbufferDepthStencil(handle: FrameGraphTextureHandle): boolean {\r\n if (handle === backbufferDepthStencilTextureHandle) {\r\n return true;\r\n }\r\n\r\n const textureEntry = this._textures.get(handle);\r\n if (!textureEntry) {\r\n return false;\r\n }\r\n\r\n return textureEntry.refHandle === backbufferDepthStencilTextureHandle;\r\n }\r\n\r\n /**\r\n * Checks if a handle is a history texture (or points to a history texture, for a dangling handle)\r\n * @param handle The handle to check\r\n * @returns True if the handle is a history texture, otherwise false\r\n */\r\n public isHistoryTexture(handle: FrameGraphTextureHandle): boolean {\r\n const entry = this._textures.get(handle);\r\n if (!entry) {\r\n return false;\r\n }\r\n\r\n handle = entry.refHandle ?? handle;\r\n\r\n return this._historyTextures.has(handle);\r\n }\r\n\r\n /**\r\n * Gets the creation options of a texture\r\n * @param handle Handle of the texture\r\n * @returns The creation options of the texture\r\n */\r\n public getTextureCreationOptions(handle: FrameGraphTextureHandle): FrameGraphTextureCreationOptions {\r\n const entry = this._textures.get(handle)!;\r\n const creationOptions = entry.creationOptions;\r\n\r\n return {\r\n size: textureSizeIsObject(creationOptions.size) ? { ...creationOptions.size } : creationOptions.size,\r\n sizeIsPercentage: creationOptions.sizeIsPercentage,\r\n options: FrameGraphTextureManager.CloneTextureOptions(creationOptions.options, entry.textureIndex),\r\n isHistoryTexture: creationOptions.isHistoryTexture,\r\n };\r\n }\r\n\r\n /**\r\n * Gets the description of a texture\r\n * @param handle Handle of the texture\r\n * @returns The description of the texture\r\n */\r\n public getTextureDescription(handle: FrameGraphTextureHandle): FrameGraphTextureDescription {\r\n const creationOptions = this.getTextureCreationOptions(handle);\r\n\r\n const size = !creationOptions.sizeIsPercentage\r\n ? textureSizeIsObject(creationOptions.size)\r\n ? creationOptions.size\r\n : { width: creationOptions.size, height: creationOptions.size }\r\n : this.getAbsoluteDimensions(creationOptions.size);\r\n\r\n return {\r\n size,\r\n options: creationOptions.options,\r\n };\r\n }\r\n\r\n /**\r\n * Gets a texture handle or creates a new texture if the handle is not provided.\r\n * If handle is not provided, newTextureName and creationOptions must be provided.\r\n * @param handle If provided, will simply return the handle\r\n * @param newTextureName Name of the new texture to create\r\n * @param creationOptions Options to use when creating the new texture\r\n * @returns The handle to the texture.\r\n */\r\n public getTextureHandleOrCreateTexture(handle?: FrameGraphTextureHandle, newTextureName?: string, creationOptions?: FrameGraphTextureCreationOptions): FrameGraphTextureHandle {\r\n if (handle === undefined) {\r\n if (newTextureName === undefined || creationOptions === undefined) {\r\n throw new Error(\"getTextureHandleOrCreateTexture: Either handle or newTextureName and creationOptions must be provided.\");\r\n }\r\n return this.createRenderTargetTexture(newTextureName, creationOptions);\r\n }\r\n return handle;\r\n }\r\n\r\n /**\r\n * Gets a texture from a handle.\r\n * Note that if the texture is a history texture, the read texture for the current frame will be returned.\r\n * @param handle The handle of the texture\r\n * @returns The texture or null if not found\r\n */\r\n public getTextureFromHandle(handle: FrameGraphTextureHandle): Nullable<InternalTexture> {\r\n const historyEntry = this._historyTextures.get(handle);\r\n if (historyEntry) {\r\n return historyEntry.textures[historyEntry.index ^ 1]; // gets the read texture\r\n }\r\n return this._textures.get(handle)!.texture;\r\n }\r\n\r\n /**\r\n * Imports a texture into the texture manager\r\n * @param name Name of the texture\r\n * @param texture Texture to import\r\n * @param handle Existing handle to use for the texture. If not provided (default), a new handle will be created.\r\n * @returns The handle to the texture\r\n */\r\n public importTexture(name: string, texture: InternalTexture, handle?: FrameGraphTextureHandle): FrameGraphTextureHandle {\r\n if (handle !== undefined) {\r\n this._freeEntry(handle);\r\n }\r\n\r\n const creationOptions: FrameGraphTextureCreationOptions = {\r\n size: { width: texture.width, height: texture.height },\r\n sizeIsPercentage: false,\r\n isHistoryTexture: false,\r\n options: {\r\n createMipMaps: texture.generateMipMaps,\r\n samples: texture.samples,\r\n types: [texture.type],\r\n formats: [texture.format],\r\n useSRGBBuffers: [texture._useSRGBBuffer],\r\n creationFlags: [texture._creationFlags],\r\n labels: texture.label ? [texture.label] : [\"imported\"],\r\n },\r\n };\r\n\r\n return this._createHandleForTexture(name, texture, creationOptions, FrameGraphTextureNamespace.External, handle);\r\n }\r\n\r\n /**\r\n * Creates a new render target texture\r\n * If multiple textures are described in FrameGraphTextureCreationOptions, the handle of the first texture is returned, handle+1 is the handle of the second texture, etc.\r\n * @param name Name of the texture\r\n * @param creationOptions Options to use when creating the texture\r\n * @param handle Existing handle to use for the texture. If not provided (default), a new handle will be created.\r\n * @returns The handle to the texture\r\n */\r\n public createRenderTargetTexture(name: string, creationOptions: FrameGraphTextureCreationOptions, handle?: FrameGraphTextureHandle): FrameGraphTextureHandle {\r\n return this._createHandleForTexture(\r\n name,\r\n null,\r\n {\r\n size: textureSizeIsObject(creationOptions.size) ? { ...creationOptions.size } : creationOptions.size,\r\n sizeIsPercentage: creationOptions.sizeIsPercentage,\r\n isHistoryTexture: creationOptions.isHistoryTexture,\r\n options: FrameGraphTextureManager.CloneTextureOptions(creationOptions.options, undefined, true),\r\n },\r\n this._isRecordingTask ? FrameGraphTextureNamespace.Task : FrameGraphTextureNamespace.Graph,\r\n handle\r\n );\r\n }\r\n\r\n /**\r\n * Creates a (frame graph) render target wrapper\r\n * Note that renderTargets or renderTargetDepth can be undefined, but not both at the same time!\r\n * @param name Name of the render target wrapper\r\n * @param renderTargets Render target handles (textures) to use\r\n * @param renderTargetDepth Render target depth handle (texture) to use\r\n * @param depthReadOnly If true, the depth buffer will be read-only\r\n * @param stencilReadOnly If true, the stencil buffer will be read-only\r\n * @returns The created render target wrapper\r\n */\r\n public createRenderTarget(\r\n name: string,\r\n renderTargets?: FrameGraphTextureHandle | FrameGraphTextureHandle[],\r\n renderTargetDepth?: FrameGraphTextureHandle,\r\n depthReadOnly?: boolean,\r\n stencilReadOnly?: boolean\r\n ): FrameGraphRenderTarget {\r\n const renderTarget = new FrameGraphRenderTarget(name, this, renderTargets, renderTargetDepth);\r\n\r\n const rtw = renderTarget.renderTargetWrapper;\r\n\r\n if (rtw !== undefined) {\r\n rtw.depthReadOnly = !!depthReadOnly;\r\n rtw.stencilReadOnly = !!stencilReadOnly;\r\n\r\n if (renderTargets) {\r\n const handles = Array.isArray(renderTargets) ? renderTargets : [renderTargets];\r\n\r\n for (let i = 0; i < handles.length; i++) {\r\n let handle = handles[i];\r\n handle = this._textures.get(handle)?.refHandle ?? handle;\r\n\r\n const historyEntry = this._historyTextures.get(handle);\r\n if (historyEntry) {\r\n historyEntry.references.push({ renderTargetWrapper: rtw, textureIndex: i });\r\n\r\n rtw.setTexture(historyEntry.textures[historyEntry.index]!, i, false);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return renderTarget;\r\n }\r\n\r\n /**\r\n * Creates a handle which is not associated with any texture.\r\n * Call resolveDanglingHandle to associate the handle with a valid texture handle.\r\n * @returns The dangling handle\r\n */\r\n public createDanglingHandle() {\r\n return FrameGraphTextureManager._Counter++;\r\n }\r\n\r\n /**\r\n * Associates a texture with a dangling handle\r\n * @param danglingHandle The dangling handle\r\n * @param handle The handle to associate with the dangling handle (if not provided, a new texture handle will be created, using the newTextureName and creationOptions parameters)\r\n * @param newTextureName The name of the new texture to create (if handle is not provided)\r\n * @param creationOptions The options to use when creating the new texture (if handle is not provided)\r\n */\r\n public resolveDanglingHandle(\r\n danglingHandle: FrameGraphTextureHandle,\r\n handle?: FrameGraphTextureHandle,\r\n newTextureName?: string,\r\n creationOptions?: FrameGraphTextureCreationOptions\r\n ) {\r\n if (handle === undefined) {\r\n if (newTextureName === undefined || creationOptions === undefined) {\r\n throw new Error(\"resolveDanglingHandle: Either handle or newTextureName and creationOptions must be provided.\");\r\n }\r\n this.createRenderTargetTexture(newTextureName, creationOptions, danglingHandle);\r\n return;\r\n }\r\n\r\n const textureEntry = this._textures.get(handle);\r\n\r\n if (textureEntry === undefined) {\r\n throw new Error(`resolveDanglingHandle: Handle ${handle} does not exist!`);\r\n }\r\n\r\n this._textures.set(danglingHandle, {\r\n texture: textureEntry.texture,\r\n refHandle: handle,\r\n name: textureEntry.name,\r\n creationOptions: {\r\n size: { ...(textureEntry.creationOptions.size as { width: number; height: number; depth?: number; layers?: number }) },\r\n options: FrameGraphTextureManager.CloneTextureOptions(textureEntry.creationOptions.options),\r\n sizeIsPercentage: textureEntry.creationOptions.sizeIsPercentage,\r\n isHistoryTexture: false,\r\n },\r\n namespace: textureEntry.namespace,\r\n textureIndex: textureEntry.textureIndex,\r\n });\r\n }\r\n\r\n /**\r\n * Gets the absolute dimensions of a texture.\r\n * @param size The size of the texture. Width and height must be expressed as a percentage of the screen size (100=100%)!\r\n * @param screenWidth The width of the screen (default: the width of the rendering canvas)\r\n * @param screenHeight The height of the screen (default: the height of the rendering canvas)\r\n * @returns The absolute dimensions of the texture\r\n */\r\n public getAbsoluteDimensions(size: TextureSize, screenWidth?: number, screenHeight?: number): { width: number; height: number } {\r\n screenWidth = this.forcedOutputScreenWidth || this.engine.getRenderWidth(true);\r\n screenHeight = this.forcedOutputScreenHeight || this.engine.getRenderHeight(true);\r\n\r\n const { width, height } = getDimensionsFromTextureSize(size);\r\n\r\n return {\r\n width: Math.floor((width * screenWidth) / 100),\r\n height: Math.floor((height * screenHeight) / 100),\r\n };\r\n }\r\n\r\n /**\r\n * Calculates the total byte size of all textures used by the frame graph texture manager (including external textures)\r\n * @param optimizedSize True if the calculation should not factor in aliased textures\r\n * @param outputWidth The output width of the frame graph. Will be used to calculate the size of percentage-based textures\r\n * @param outputHeight The output height of the frame graph. Will be used to calculate the size of percentage-based textures\r\n * @returns The total size of all textures\r\n */\r\n public computeTotalTextureSize(optimizedSize: boolean, outputWidth: number, outputHeight: number) {\r\n let totalSize = 0;\r\n\r\n this._textures.forEach((entry, handle) => {\r\n if (handle === backbufferColorTextureHandle || handle === backbufferDepthStencilTextureHandle || entry.refHandle !== undefined) {\r\n return;\r\n }\r\n if (optimizedSize && entry.aliasHandle !== undefined) {\r\n return;\r\n }\r\n\r\n const options = entry.creationOptions;\r\n const textureIndex = entry.textureIndex || 0;\r\n const dimensions = options.sizeIsPercentage ? this.getAbsoluteDimensions(options.size, outputWidth, outputHeight) : getDimensionsFromTextureSize(options.size);\r\n\r\n const blockInfo = FrameGraphTextureManager._GetTextureBlockInformation(\r\n options.options.types?.[textureIndex] ?? Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n options.options.formats![textureIndex]\r\n );\r\n\r\n const textureByteSize = Math.ceil(dimensions.width / blockInfo.width) * Math.ceil(dimensions.height / blockInfo.height) * blockInfo.length;\r\n\r\n let byteSize = textureByteSize;\r\n\r\n if (options.options.createMipMaps) {\r\n byteSize = Math.floor((byteSize * 4) / 3);\r\n }\r\n\r\n if ((options.options.samples || 1) > 1) {\r\n // We need an additional texture in the case of MSAA\r\n byteSize += textureByteSize;\r\n }\r\n\r\n totalSize += byteSize;\r\n });\r\n\r\n return totalSize;\r\n }\r\n\r\n /** @internal */\r\n public _dispose(): void {\r\n this._releaseTextures();\r\n }\r\n\r\n /** @internal */\r\n public _allocateTextures(tasks?: FrameGraphTask[]): void {\r\n if (tasks) {\r\n this._optimizeTextureAllocation(tasks);\r\n }\r\n\r\n this._textures.forEach((entry) => {\r\n if (!entry.texture) {\r\n if (entry.refHandle !== undefined) {\r\n // entry is a dangling handle which has been resolved to point to refHandle\r\n // We simply update the texture to point to the refHandle texture\r\n const refEntry = this._textures.get(entry.refHandle)!;\r\n\r\n entry.texture = refEntry.texture;\r\n entry.texture?.incrementReferences();\r\n\r\n if (refEntry.refHandle === backbufferColorTextureHandle) {\r\n entry.refHandle = backbufferColorTextureHandle;\r\n }\r\n if (refEntry.refHandle === backbufferDepthStencilTextureHandle) {\r\n entry.refHandle = backbufferDepthStencilTextureHandle;\r\n }\r\n } else if (entry.namespace !== FrameGraphTextureNamespace.External) {\r\n if (entry.aliasHandle !== undefined) {\r\n const aliasEntry = this._textures.get(entry.aliasHandle)!;\r\n\r\n entry.texture = aliasEntry.texture!;\r\n entry.texture.incrementReferences();\r\n } else {\r\n const creationOptions = entry.creationOptions;\r\n const size = creationOptions.sizeIsPercentage ? this.getAbsoluteDimensions(creationOptions.size) : creationOptions.size;\r\n const textureIndex = entry.textureIndex || 0;\r\n\r\n const internalTextureCreationOptions: InternalTextureCreationOptions = {\r\n createMipMaps: creationOptions.options.createMipMaps,\r\n samples: creationOptions.options.samples,\r\n type: creationOptions.options.types?.[textureIndex],\r\n format: creationOptions.options.formats?.[textureIndex],\r\n useSRGBBuffer: creationOptions.options.useSRGBBuffers?.[textureIndex],\r\n creationFlags: creationOptions.options.creationFlags?.[textureIndex],\r\n label: creationOptions.options.labels?.[textureIndex] ?? `${entry.name}${textureIndex > 0 ? \"#\" + textureIndex : \"\"}`,\r\n samplingMode: Constants.TEXTURE_NEAREST_SAMPLINGMODE,\r\n createMSAATexture: creationOptions.options.samples! > 1,\r\n };\r\n\r\n const isDepthTexture = IsDepthTexture(internalTextureCreationOptions.format!);\r\n const hasStencil = HasStencilAspect(internalTextureCreationOptions.format!);\r\n const source =\r\n isDepthTexture && hasStencil\r\n ? InternalTextureSource.DepthStencil\r\n : isDepthTexture || hasStencil\r\n ? InternalTextureSource.Depth\r\n : InternalTextureSource.RenderTarget;\r\n\r\n const internalTexture = this.engine._createInternalTexture(size, internalTextureCreationOptions, false, source);\r\n\r\n if (isDepthTexture) {\r\n internalTexture.type = GetTypeForDepthTexture(internalTexture.format);\r\n }\r\n\r\n entry.texture = internalTexture;\r\n }\r\n }\r\n }\r\n\r\n if (entry.texture && entry.refHandle === undefined) {\r\n entry.debug?.dispose();\r\n entry.debug = this._createDebugTexture(entry.name, entry.texture);\r\n }\r\n });\r\n\r\n this._historyTextures.forEach((entry) => {\r\n for (let i = 0; i < entry.handles.length; i++) {\r\n entry.textures[i] = this._textures.get(entry.handles[i])!.texture;\r\n }\r\n });\r\n }\r\n\r\n /** @internal */\r\n public _releaseTextures(releaseAll = true): void {\r\n this._textures.forEach((entry, handle) => {\r\n if (entry.lifespan) {\r\n entry.lifespan.firstTask = Number.MAX_VALUE;\r\n entry.lifespan.lastTask = 0;\r\n }\r\n\r\n entry.aliasHandle = undefined;\r\n\r\n if (releaseAll || entry.namespace !== FrameGraphTextureNamespace.External) {\r\n entry.debug?.dispose();\r\n entry.debug = undefined;\r\n }\r\n\r\n if (entry.namespace === FrameGraphTextureNamespace.External) {\r\n return;\r\n }\r\n\r\n // We dispose of \"Graph\" and \"Task\" textures:\r\n // - \"Graph\" textures will be recreated by _allocateTextures because the entry still exists in this._textures, but entry.texture is null\r\n // - \"Task\" textures will be re-added to this._textures when the task is recorded (by a call to FrameGraph.build): that's why we delete the entry from this._textures below\r\n entry.texture?.dispose();\r\n entry.texture = null;\r\n\r\n if (releaseAll || entry.namespace === FrameGraphTextureNamespace.Task) {\r\n this._textures.delete(handle);\r\n }\r\n });\r\n\r\n this._historyTextures.forEach((entry) => {\r\n for (let i = 0; i < entry.handles.length; i++) {\r\n entry.textures[i] = null;\r\n }\r\n });\r\n\r\n if (releaseAll) {\r\n this._textures.clear();\r\n this._historyTextures.clear();\r\n this._addSystemTextures();\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _updateHistoryTextures(): void {\r\n this._historyTextures.forEach((entry) => {\r\n entry.index = entry.index ^ 1;\r\n const currentTexture = entry.textures[entry.index];\r\n if (currentTexture) {\r\n for (const { renderTargetWrapper, textureIndex } of entry.references) {\r\n renderTargetWrapper.setTexture(currentTexture, textureIndex, false);\r\n }\r\n }\r\n });\r\n }\r\n\r\n private _addSystemTextures() {\r\n const size = { width: this.engine.getRenderWidth(true), height: this.engine.getRenderHeight(true) };\r\n\r\n this._textures.set(backbufferColorTextureHandle, {\r\n name: \"backbuffer color\",\r\n texture: null,\r\n creationOptions: {\r\n size,\r\n options: {\r\n createMipMaps: false,\r\n samples: this.engine.getCreationOptions().antialias ? 4 : 1,\r\n types: [Constants.TEXTURETYPE_UNSIGNED_BYTE], // todo? get from engine\r\n formats: [Constants.TEXTUREFORMAT_RGBA], // todo? get from engine\r\n useSRGBBuffers: [false],\r\n creationFlags: [0],\r\n labels: [\"backbuffer color\"],\r\n },\r\n sizeIsPercentage: false,\r\n },\r\n namespace: FrameGraphTextureNamespace.External,\r\n });\r\n\r\n this._textures.set(backbufferDepthStencilTextureHandle, {\r\n name: \"backbuffer depth/stencil\",\r\n texture: null,\r\n creationOptions: {\r\n size,\r\n options: {\r\n createMipMaps: false,\r\n samples: this.engine.getCreationOptions().antialias ? 4 : 1,\r\n types: [Constants.TEXTURETYPE_UNSIGNED_BYTE], // todo? get from engine\r\n formats: [Constants.TEXTUREFORMAT_DEPTH24], // todo? get from engine\r\n useSRGBBuffers: [false],\r\n creationFlags: [0],\r\n labels: [\"backbuffer depth/stencil\"],\r\n },\r\n sizeIsPercentage: false,\r\n },\r\n namespace: FrameGraphTextureNamespace.External,\r\n });\r\n }\r\n\r\n private _createDebugTexture(name: string, texture: InternalTexture): Texture | undefined {\r\n if (!this._debugTextures) {\r\n return;\r\n }\r\n\r\n const textureDebug = new Texture(null, this._scene);\r\n\r\n textureDebug.name = name;\r\n textureDebug._texture = texture;\r\n textureDebug._texture.incrementReferences();\r\n\r\n return textureDebug;\r\n }\r\n\r\n private _freeEntry(handle: number): void {\r\n const entry = this._textures.get(handle);\r\n\r\n if (entry) {\r\n entry.debug?.dispose();\r\n this._textures.delete(handle);\r\n }\r\n }\r\n\r\n private _createHandleForTexture(\r\n name: string,\r\n texture: Nullable<InternalTexture>,\r\n creationOptions: FrameGraphTextureCreationOptions,\r\n namespace: FrameGraphTextureNamespace,\r\n handle?: FrameGraphTextureHandle,\r\n textureIndex?: number\r\n ): FrameGraphTextureHandle {\r\n handle = handle ?? FrameGraphTextureManager._Counter++;\r\n textureIndex = textureIndex || 0;\r\n\r\n const textureName = creationOptions.isHistoryTexture ? `${name} ping` : name;\r\n\r\n let label = creationOptions.options.labels?.[textureIndex] ?? \"\";\r\n if (label === textureName) {\r\n label = \"\";\r\n }\r\n\r\n const textureEntry: TextureEntry = {\r\n texture,\r\n name: `${textureName}${label ? \" \" + label : \"\"}`,\r\n creationOptions: {\r\n size: textureSizeIsObject(creationOptions.size) ? creationOptions.size : { width: creationOptions.size, height: creationOptions.size },\r\n options: creationOptions.options,\r\n sizeIsPercentage: creationOptions.sizeIsPercentage,\r\n isHistoryTexture: creationOptions.isHistoryTexture,\r\n },\r\n namespace,\r\n textureIndex,\r\n textureDescriptionHash: this._createTextureDescriptionHash(creationOptions),\r\n lifespan: {\r\n firstTask: Number.MAX_VALUE,\r\n lastTask: 0,\r\n },\r\n };\r\n\r\n this._textures.set(handle, textureEntry);\r\n\r\n if (namespace === FrameGraphTextureNamespace.External) {\r\n return handle;\r\n }\r\n\r\n if (creationOptions.isHistoryTexture) {\r\n const pongCreationOptions: FrameGraphTextureCreationOptions = {\r\n size: { ...(textureEntry.creationOptions.size as { width: number; height: number }) },\r\n options: { ...textureEntry.creationOptions.options },\r\n sizeIsPercentage: textureEntry.creationOptions.sizeIsPercentage,\r\n isHistoryTexture: false,\r\n };\r\n\r\n const pongTexture = this._createHandleForTexture(`${name} pong`, null, pongCreationOptions, namespace);\r\n\r\n this._historyTextures.set(handle, { textures: [null, null], handles: [handle, pongTexture], index: 0, references: [] });\r\n\r\n return handle;\r\n }\r\n\r\n if (creationOptions.options.types && creationOptions.options.types.length > 1 && textureIndex === 0) {\r\n const textureCount = creationOptions.options.types.length;\r\n const creationOptionsForTexture: FrameGraphTextureCreationOptions = {\r\n size: textureSizeIsObject(creationOptions.size) ? creationOptions.size : { width: creationOptions.size, height: creationOptions.size },\r\n options: creationOptions.options,\r\n sizeIsPercentage: creationOptions.sizeIsPercentage,\r\n };\r\n\r\n for (let i = 1; i < textureCount; i++) {\r\n this._createHandleForTexture(textureName, null, creationOptionsForTexture, namespace, handle + i, i);\r\n }\r\n\r\n FrameGraphTextureManager._Counter += textureCount - 1;\r\n }\r\n\r\n return handle;\r\n }\r\n\r\n private _createTextureDescriptionHash(options: FrameGraphTextureCreationOptions): string {\r\n const hash: string[] = [];\r\n\r\n hash.push(textureSizeIsObject(options.size) ? `${options.size.width}_${options.size.height}` : `${options.size}`);\r\n hash.push(options.sizeIsPercentage ? \"%\" : \"A\");\r\n hash.push(options.options.createMipMaps ? \"M\" : \"N\");\r\n hash.push(options.options.samples ? `${options.options.samples}` : \"S1\");\r\n hash.push(options.options.types ? options.options.types.join(\"_\") : `${Constants.TEXTURETYPE_UNSIGNED_BYTE}`);\r\n hash.push(options.options.formats ? options.options.formats.join(\"_\") : `${Constants.TEXTUREFORMAT_RGBA}`);\r\n hash.push(options.options.useSRGBBuffers ? options.options.useSRGBBuffers.join(\"_\") : \"false\");\r\n hash.push(options.options.creationFlags ? options.options.creationFlags.join(\"_\") : \"0\");\r\n\r\n return hash.join(\"_\");\r\n }\r\n\r\n private _optimizeTextureAllocation(tasks: FrameGraphTask[]): void {\r\n this._computeTextureLifespan(tasks);\r\n\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(`================== Optimization of texture allocation ==================`);\r\n }\r\n\r\n const cache: Map<string, Array<[FrameGraphTextureHandle, Array<TextureLifespan>]>> = new Map();\r\n\r\n const iterator = this._textures.keys();\r\n for (let key = iterator.next(); key.done !== true; key = iterator.next()) {\r\n const textureHandle = key.value;\r\n const textureEntry = this._textures.get(textureHandle)!;\r\n if (textureEntry.refHandle !== undefined || textureEntry.namespace === FrameGraphTextureNamespace.External || this._historyTextures.has(textureHandle)) {\r\n continue;\r\n }\r\n\r\n const textureHash = textureEntry.textureDescriptionHash!;\r\n const textureLifespan = textureEntry.lifespan!;\r\n\r\n const cacheEntries = cache.get(textureHash);\r\n if (cacheEntries) {\r\n let cacheEntryFound = false;\r\n for (const cacheEntry of cacheEntries) {\r\n const [sourceHandle, lifespanArray] = cacheEntry;\r\n\r\n let overlapped = false;\r\n for (const lifespan of lifespanArray) {\r\n if (lifespan.firstTask <= textureLifespan.lastTask && lifespan.lastTask >= textureLifespan.firstTask) {\r\n overlapped = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!overlapped) {\r\n // No overlap between texture lifespan and all lifespans in the array, this texture can reuse the same entry cache\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(`Texture ${textureHandle} (${textureEntry.name}) reuses cache entry ${sourceHandle}`);\r\n }\r\n\r\n lifespanArray.push(textureLifespan);\r\n textureEntry.aliasHandle = sourceHandle;\r\n cacheEntryFound = true;\r\n break;\r\n }\r\n }\r\n if (!cacheEntryFound) {\r\n cacheEntries.push([textureHandle, [textureLifespan]]);\r\n }\r\n } else {\r\n cache.set(textureHash, [[textureHandle, [textureLifespan]]]);\r\n }\r\n }\r\n }\r\n\r\n // Loop through all task/pass dependencies and compute the lifespan of each texture (that is, the first task/pass that uses it and the last task/pass that uses it)\r\n private _computeTextureLifespan(tasks: FrameGraphTask[]): void {\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(`================== Dump of texture dependencies for all tasks/passes ==================`);\r\n }\r\n\r\n for (let t = 0; t < tasks.length; ++t) {\r\n const task = tasks[t];\r\n\r\n if (task.passes.length > 0) {\r\n this._computeTextureLifespanForPasses(task, t, task.passes);\r\n }\r\n\r\n if (task.passesDisabled.length > 0) {\r\n this._computeTextureLifespanForPasses(task, t, task.passesDisabled);\r\n }\r\n\r\n if (task.dependencies) {\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(`task#${t} (${task.name}), global dependencies`);\r\n }\r\n\r\n this._updateLifespan(t * 100 + 99, task.dependencies);\r\n }\r\n }\r\n\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(`================== Texture lifespans ==================`);\r\n const iterator = this._textures.keys();\r\n for (let key = iterator.next(); key.done !== true; key = iterator.next()) {\r\n const textureHandle = key.value;\r\n const textureEntry = this._textures.get(textureHandle)!;\r\n if (textureEntry.refHandle !== undefined || textureEntry.namespace === FrameGraphTextureNamespace.External || this._historyTextures.has(textureHandle)) {\r\n continue;\r\n }\r\n Logger.Log(`${textureHandle} (${textureEntry.name}): ${textureEntry.lifespan!.firstTask} - ${textureEntry.lifespan!.lastTask}`);\r\n }\r\n }\r\n }\r\n\r\n private _computeTextureLifespanForPasses(task: FrameGraphTask, taskIndex: number, passes: IFrameGraphPass[]): void {\r\n for (let p = 0; p < passes.length; ++p) {\r\n const dependencies = new Set<FrameGraphTextureHandle>();\r\n const pass = passes[p];\r\n\r\n if (!FrameGraphRenderPass.IsRenderPass(pass)) {\r\n continue;\r\n }\r\n\r\n pass.collectDependencies(dependencies);\r\n\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(`task#${taskIndex} (${task.name}), pass#${p} (${pass.name})`);\r\n }\r\n\r\n this._updateLifespan(taskIndex * 100 + p, dependencies);\r\n }\r\n }\r\n\r\n private _updateLifespan(passOrderNum: number, dependencies: Set<FrameGraphTextureHandle>) {\r\n const iterator = dependencies.keys();\r\n for (let key = iterator.next(); key.done !== true; key = iterator.next()) {\r\n const textureHandle = key.value;\r\n let textureEntry = this._textures.get(textureHandle);\r\n if (!textureEntry) {\r\n throw new Error(`FrameGraph._computeTextureLifespan: Texture handle \"${textureHandle}\" not found in the texture manager.`);\r\n }\r\n let handle = textureHandle;\r\n while (textureEntry.refHandle !== undefined) {\r\n handle = textureEntry.refHandle;\r\n textureEntry = this._textures.get(handle);\r\n if (!textureEntry) {\r\n throw new Error(`FrameGraph._computeTextureLifespan: Texture handle \"${handle}\" not found in the texture manager (source handle=\"${textureHandle}\").`);\r\n }\r\n }\r\n if (textureEntry.namespace === FrameGraphTextureNamespace.External || this._historyTextures.has(handle)) {\r\n continue;\r\n }\r\n\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(` ${handle} (${textureEntry.name})`);\r\n }\r\n\r\n textureEntry.lifespan!.firstTask = Math.min(textureEntry.lifespan!.firstTask, passOrderNum);\r\n textureEntry.lifespan!.lastTask = Math.max(textureEntry.lifespan!.lastTask, passOrderNum);\r\n }\r\n }\r\n\r\n /**\r\n * Clones a texture options\r\n * @param options The options to clone\r\n * @param textureIndex The index of the texture in the types, formats, etc array of FrameGraphTextureOptions. If not provided, all options are cloned.\r\n * @param preserveLabels True if the labels should be preserved (default: false)\r\n * @returns The cloned options\r\n */\r\n public static CloneTextureOptions(options: FrameGraphTextureOptions, textureIndex?: number, preserveLabels?: boolean): FrameGraphTextureOptions {\r\n return textureIndex !== undefined\r\n ? {\r\n createMipMaps: options.createMipMaps,\r\n samples: options.samples,\r\n types: options.types ? [options.types[textureIndex]] : undefined,\r\n formats: options.formats ? [options.formats[textureIndex]] : undefined,\r\n useSRGBBuffers: options.useSRGBBuffers ? [options.useSRGBBuffers[textureIndex]] : undefined,\r\n creationFlags: options.creationFlags ? [options.creationFlags[textureIndex]] : undefined,\r\n labels: options.labels ? [options.labels[textureIndex]] : undefined,\r\n }\r\n : {\r\n createMipMaps: options.createMipMaps,\r\n samples: options.samples,\r\n types: options.types ? [...options.types] : undefined,\r\n formats: options.formats ? [...options.formats] : undefined,\r\n useSRGBBuffers: options.useSRGBBuffers ? [...options.useSRGBBuffers] : undefined,\r\n creationFlags: options.creationFlags ? [...options.creationFlags] : undefined,\r\n labels: options.labels && preserveLabels ? [...options.labels] : undefined,\r\n };\r\n }\r\n\r\n /**\r\n * Gets the texture block information.\r\n * @param type Type of the texture.\r\n * @param format Format of the texture.\r\n * @returns The texture block information. You can calculate the byte size of the texture by doing: Math.ceil(width / blockInfo.width) * Math.ceil(height / blockInfo.height) * blockInfo.length\r\n */\r\n private static _GetTextureBlockInformation(type: number, format: number): { width: number; height: number; length: number } {\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_DEPTH16:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTUREFORMAT_DEPTH24:\r\n return { width: 1, height: 1, length: 3 };\r\n case Constants.TEXTUREFORMAT_DEPTH24_STENCIL8:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_DEPTH32_FLOAT:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8:\r\n return { width: 1, height: 1, length: 5 };\r\n case Constants.TEXTUREFORMAT_STENCIL8:\r\n return { width: 1, height: 1, length: 1 };\r\n\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM:\r\n return { width: 4, height: 4, length: 16 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT:\r\n return { width: 4, height: 4, length: 16 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT:\r\n return { width: 4, height: 4, length: 16 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5:\r\n return { width: 4, height: 4, length: 16 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3:\r\n return { width: 4, height: 4, length: 16 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1:\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1:\r\n return { width: 4, height: 4, length: 8 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4:\r\n return { width: 4, height: 4, length: 16 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL:\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2:\r\n return { width: 4, height: 4, length: 8 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC:\r\n return { width: 4, height: 4, length: 16 };\r\n }\r\n\r\n switch (type) {\r\n case Constants.TEXTURETYPE_BYTE:\r\n case Constants.TEXTURETYPE_UNSIGNED_BYTE:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_R:\r\n case Constants.TEXTUREFORMAT_R_INTEGER:\r\n case Constants.TEXTUREFORMAT_ALPHA:\r\n case Constants.TEXTUREFORMAT_LUMINANCE:\r\n case Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:\r\n return { width: 1, height: 1, length: 1 };\r\n case Constants.TEXTUREFORMAT_RG:\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTUREFORMAT_RGB:\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n return { width: 1, height: 1, length: 3 };\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return { width: 1, height: 1, length: 4 };\r\n default:\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n case Constants.TEXTURETYPE_SHORT:\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n return { width: 1, height: 1, length: 6 };\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return { width: 1, height: 1, length: 8 };\r\n default:\r\n return { width: 1, height: 1, length: 8 };\r\n }\r\n case Constants.TEXTURETYPE_INT:\r\n case Constants.TEXTURETYPE_UNSIGNED_INTEGER: // Refers to UNSIGNED_INT\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return { width: 1, height: 1, length: 8 };\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n return { width: 1, height: 1, length: 12 };\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return { width: 1, height: 1, length: 16 };\r\n default:\r\n return { width: 1, height: 1, length: 16 };\r\n }\r\n case Constants.TEXTURETYPE_FLOAT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_RG:\r\n return { width: 1, height: 1, length: 8 };\r\n case Constants.TEXTUREFORMAT_RGB:\r\n return { width: 1, height: 1, length: 12 };\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return { width: 1, height: 1, length: 16 };\r\n default:\r\n return { width: 1, height: 1, length: 16 };\r\n }\r\n case Constants.TEXTURETYPE_HALF_FLOAT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTUREFORMAT_RG:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_RGB:\r\n return { width: 1, height: 1, length: 6 };\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return { width: 1, height: 1, length: 8 };\r\n default:\r\n return { width: 1, height: 1, length: 8 };\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return { width: 1, height: 1, length: 4 };\r\n default:\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return { width: 1, height: 1, length: 4 };\r\n default:\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return { width: 1, height: 1, length: 4 };\r\n default:\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n }\r\n\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"frameGraphTextureManager.js","sourceRoot":"","sources":["../../../../dev/core/src/FrameGraph/frameGraphTextureManager.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACjH,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AACtG,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;A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,CAAC;gBAClD,CAAC;YACL,KAAK,SAAS,CAAC,kCAAkC;gBAC7C,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;YAC9C,KAAK,SAAS,CAAC,kCAAkC;gBAC7C,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;YAC9C,KAAK,SAAS,CAAC,uCAAuC;gBAClD,QAAQ,MAAM,EAAE,CAAC;oBACb,KAAK,SAAS,CAAC,kBAAkB;wBAC7B,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;oBAC9C,KAAK,SAAS,CAAC,0BAA0B;wBACrC,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;oBAC9C;wBACI,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;gBAClD,CAAC;QACT,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAC9C,CAAC;;AA5oCc,iCAAQ,GAAG,CAAC,AAAJ,CAAK,CAAC,+CAA+C","sourcesContent":["import type {\r\n Scene,\r\n AbstractEngine,\r\n TextureSize,\r\n Nullable,\r\n FrameGraphTextureCreationOptions,\r\n FrameGraphTextureHandle,\r\n InternalTextureCreationOptions,\r\n InternalTexture,\r\n FrameGraphTextureOptions,\r\n FrameGraphTextureDescription,\r\n RenderTargetWrapper,\r\n FrameGraphTask,\r\n IFrameGraphPass,\r\n} from \"core/index\";\r\nimport { getDimensionsFromTextureSize, textureSizeIsObject } from \"../Materials/Textures/textureCreationOptions\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { backbufferColorTextureHandle, backbufferDepthStencilTextureHandle } from \"./frameGraphTypes\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { InternalTextureSource } from \"../Materials/Textures/internalTexture\";\r\nimport { FrameGraphRenderTarget } from \"./frameGraphRenderTarget\";\r\nimport { FrameGraphRenderPass } from \"./Passes/renderPass\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { GetTypeForDepthTexture, IsDepthTexture, HasStencilAspect } from \"core/Materials/Textures/textureHelper.functions\";\r\n\r\ntype HistoryTexture = {\r\n textures: Array<Nullable<InternalTexture>>;\r\n handles: Array<FrameGraphTextureHandle>;\r\n index: number; // current index in textures array - in the current frame, textures[index] is the write texture, textures[index^1] is the read texture - index is flipped at the end of each frame\r\n references: Array<{ renderTargetWrapper: RenderTargetWrapper; textureIndex: number }>; // render target wrappers that reference this history texture\r\n};\r\n\r\ntype TextureLifespan = {\r\n firstTask: number;\r\n lastTask: number;\r\n};\r\n\r\ntype TextureEntry = {\r\n texture: Nullable<InternalTexture>;\r\n name: string;\r\n creationOptions: FrameGraphTextureCreationOptions; // in TextureEntry, creationOptions.size is always an object\r\n namespace: FrameGraphTextureNamespace;\r\n textureIndex?: number; // Index of the texture in the types, formats, etc array of FrameGraphTextureOptions (default: 0)\r\n debug?: Texture;\r\n refHandle?: FrameGraphTextureHandle; // Handle of the texture this one is referencing - used for dangling handles\r\n textureDescriptionHash?: string; // a hash of the texture creation options\r\n lifespan?: TextureLifespan;\r\n aliasHandle?: FrameGraphTextureHandle; // Handle of the texture this one is aliasing - can be set after execution of texture allocation optimization\r\n};\r\n\r\nenum FrameGraphTextureNamespace {\r\n Task,\r\n Graph,\r\n External,\r\n}\r\n\r\n/**\r\n * Manages the textures used by a frame graph\r\n * @experimental\r\n */\r\nexport class FrameGraphTextureManager {\r\n private static _Counter = 2; // 0 and 1 are reserved for backbuffer textures\r\n\r\n /** @internal */\r\n public readonly _textures: Map<FrameGraphTextureHandle, TextureEntry> = new Map();\r\n\r\n /** @internal */\r\n public readonly _historyTextures: Map<FrameGraphTextureHandle, HistoryTexture> = new Map();\r\n\r\n /** @internal */\r\n public _isRecordingTask = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if debug logs should be shown when applying texture allocation optimization (default: false)\r\n */\r\n public showDebugLogsForTextureAllcationOptimization = false;\r\n\r\n private _backBufferTextureEntry: Nullable<TextureEntry> = null;\r\n private _backBufferDepthStencilTextureEntry: Nullable<TextureEntry> = null;\r\n private _backBufferTextureOverriden = false;\r\n\r\n /**\r\n * Constructs a new instance of the texture manager\r\n * @param engine The engine to use\r\n * @param _debugTextures If true, debug textures will be created so that they are visible in the inspector\r\n * @param _scene The scene the manager belongs to\r\n */\r\n constructor(\r\n public readonly engine: AbstractEngine,\r\n private readonly _debugTextures = false,\r\n private readonly _scene: Scene\r\n ) {\r\n this._addSystemTextures();\r\n }\r\n\r\n /**\r\n * Checks if a handle is a backbuffer handle (color or depth/stencil)\r\n * @param handle The handle to check\r\n * @returns True if the handle is a backbuffer handle\r\n */\r\n public isBackbuffer(handle: FrameGraphTextureHandle): boolean {\r\n if (this._backBufferTextureOverriden) {\r\n return false;\r\n }\r\n\r\n return this._isBackbuffer(handle);\r\n }\r\n\r\n /** @internal */\r\n public _isBackbuffer(handle: FrameGraphTextureHandle): boolean {\r\n if (handle === backbufferColorTextureHandle || handle === backbufferDepthStencilTextureHandle) {\r\n return true;\r\n }\r\n\r\n const textureEntry = this._textures.get(handle);\r\n if (!textureEntry) {\r\n return false;\r\n }\r\n\r\n return textureEntry.refHandle === backbufferColorTextureHandle || textureEntry.refHandle === backbufferDepthStencilTextureHandle;\r\n }\r\n\r\n /**\r\n * Checks if a handle is a backbuffer color handle\r\n * @param handle The handle to check\r\n * @returns True if the handle is a backbuffer color handle\r\n */\r\n public isBackbufferColor(handle: FrameGraphTextureHandle): boolean {\r\n if (this._backBufferTextureOverriden) {\r\n return false;\r\n }\r\n\r\n if (handle === backbufferColorTextureHandle) {\r\n return true;\r\n }\r\n\r\n const textureEntry = this._textures.get(handle);\r\n if (!textureEntry) {\r\n return false;\r\n }\r\n\r\n return textureEntry.refHandle === backbufferColorTextureHandle;\r\n }\r\n\r\n /**\r\n * Checks if a handle is a backbuffer depth/stencil handle\r\n * @param handle The handle to check\r\n * @returns True if the handle is a backbuffer depth/stencil handle\r\n */\r\n public isBackbufferDepthStencil(handle: FrameGraphTextureHandle): boolean {\r\n if (this._backBufferTextureOverriden) {\r\n return false;\r\n }\r\n\r\n if (handle === backbufferDepthStencilTextureHandle) {\r\n return true;\r\n }\r\n\r\n const textureEntry = this._textures.get(handle);\r\n if (!textureEntry) {\r\n return false;\r\n }\r\n\r\n return textureEntry.refHandle === backbufferDepthStencilTextureHandle;\r\n }\r\n\r\n /**\r\n * Checks if a handle is a history texture (or points to a history texture, for a dangling handle)\r\n * @param handle The handle to check\r\n * @returns True if the handle is a history texture, otherwise false\r\n */\r\n public isHistoryTexture(handle: FrameGraphTextureHandle): boolean {\r\n const entry = this._textures.get(handle);\r\n if (!entry) {\r\n return false;\r\n }\r\n\r\n handle = entry.refHandle ?? handle;\r\n\r\n return this._historyTextures.has(handle);\r\n }\r\n\r\n /**\r\n * Gets the creation options of a texture\r\n * @param handle Handle of the texture\r\n * @returns The creation options of the texture\r\n */\r\n public getTextureCreationOptions(handle: FrameGraphTextureHandle): FrameGraphTextureCreationOptions {\r\n handle = this._textures.get(handle)?.refHandle ?? handle;\r\n\r\n const entry = this._textures.get(handle)!;\r\n const creationOptions = entry.creationOptions;\r\n\r\n return {\r\n size: textureSizeIsObject(creationOptions.size) ? { ...creationOptions.size } : creationOptions.size,\r\n sizeIsPercentage: creationOptions.sizeIsPercentage,\r\n options: FrameGraphTextureManager.CloneTextureOptions(creationOptions.options, entry.textureIndex),\r\n isHistoryTexture: creationOptions.isHistoryTexture,\r\n };\r\n }\r\n\r\n /**\r\n * Gets the description of a texture\r\n * @param handle Handle of the texture\r\n * @returns The description of the texture\r\n */\r\n public getTextureDescription(handle: FrameGraphTextureHandle): FrameGraphTextureDescription {\r\n const creationOptions = this.getTextureCreationOptions(handle);\r\n\r\n const size = !creationOptions.sizeIsPercentage\r\n ? textureSizeIsObject(creationOptions.size)\r\n ? creationOptions.size\r\n : { width: creationOptions.size, height: creationOptions.size }\r\n : this.getAbsoluteDimensions(creationOptions.size);\r\n\r\n return {\r\n size,\r\n options: creationOptions.options,\r\n };\r\n }\r\n\r\n /**\r\n * Gets a texture handle or creates a new texture if the handle is not provided.\r\n * If handle is not provided, newTextureName and creationOptions must be provided.\r\n * @param handle If provided, will simply return the handle\r\n * @param newTextureName Name of the new texture to create\r\n * @param creationOptions Options to use when creating the new texture\r\n * @returns The handle to the texture.\r\n */\r\n public getTextureHandleOrCreateTexture(handle?: FrameGraphTextureHandle, newTextureName?: string, creationOptions?: FrameGraphTextureCreationOptions): FrameGraphTextureHandle {\r\n if (handle === undefined) {\r\n if (newTextureName === undefined || creationOptions === undefined) {\r\n throw new Error(\"getTextureHandleOrCreateTexture: Either handle or newTextureName and creationOptions must be provided.\");\r\n }\r\n return this.createRenderTargetTexture(newTextureName, creationOptions);\r\n }\r\n return handle;\r\n }\r\n\r\n /**\r\n * Gets a texture from a handle.\r\n * Note that if the texture is a history texture, the read texture for the current frame will be returned, except if historyGetWriteTexture is true.\r\n * @param handle The handle of the texture\r\n * @param historyGetWriteTexture If true and the texture is a history texture, the write texture for the current frame will be returned (default: false)\r\n * @returns The texture or null if not found\r\n */\r\n public getTextureFromHandle(handle: FrameGraphTextureHandle, historyGetWriteTexture?: boolean): Nullable<InternalTexture> {\r\n const entry = this._textures.get(handle);\r\n const refHandle = entry?.refHandle;\r\n const finalEntry = refHandle !== undefined ? this._textures.get(refHandle) : entry;\r\n const finalHandle = refHandle !== undefined ? refHandle : handle;\r\n\r\n const historyEntry = this._historyTextures.get(finalHandle);\r\n if (historyEntry) {\r\n return historyEntry.textures[historyGetWriteTexture ? historyEntry.index : historyEntry.index ^ 1];\r\n }\r\n return finalEntry!.texture;\r\n }\r\n\r\n /**\r\n * Imports a texture into the texture manager\r\n * @param name Name of the texture\r\n * @param texture Texture to import\r\n * @param handle Existing handle to use for the texture. If not provided (default), a new handle will be created.\r\n * @returns The handle to the texture\r\n */\r\n public importTexture(name: string, texture: InternalTexture, handle?: FrameGraphTextureHandle): FrameGraphTextureHandle {\r\n if (handle !== undefined) {\r\n this._freeEntry(handle);\r\n }\r\n\r\n const creationOptions: FrameGraphTextureCreationOptions = {\r\n size: { width: texture.width, height: texture.height },\r\n sizeIsPercentage: false,\r\n isHistoryTexture: false,\r\n options: {\r\n createMipMaps: texture.generateMipMaps,\r\n samples: texture.samples,\r\n types: [texture.type],\r\n formats: [texture.format],\r\n useSRGBBuffers: [texture._useSRGBBuffer],\r\n creationFlags: [texture._creationFlags],\r\n labels: texture.label ? [texture.label] : [\"imported\"],\r\n },\r\n };\r\n\r\n return this._createHandleForTexture(name, texture, creationOptions, FrameGraphTextureNamespace.External, handle);\r\n }\r\n\r\n /**\r\n * Creates a new render target texture\r\n * If multiple textures are described in FrameGraphTextureCreationOptions, the handle of the first texture is returned, handle+1 is the handle of the second texture, etc.\r\n * @param name Name of the texture\r\n * @param creationOptions Options to use when creating the texture\r\n * @param handle Existing handle to use for the texture. If not provided (default), a new handle will be created.\r\n * @returns The handle to the texture\r\n */\r\n public createRenderTargetTexture(name: string, creationOptions: FrameGraphTextureCreationOptions, handle?: FrameGraphTextureHandle): FrameGraphTextureHandle {\r\n return this._createHandleForTexture(\r\n name,\r\n null,\r\n {\r\n size: textureSizeIsObject(creationOptions.size) ? { ...creationOptions.size } : creationOptions.size,\r\n sizeIsPercentage: creationOptions.sizeIsPercentage,\r\n isHistoryTexture: creationOptions.isHistoryTexture,\r\n options: FrameGraphTextureManager.CloneTextureOptions(creationOptions.options, undefined, true),\r\n },\r\n this._isRecordingTask ? FrameGraphTextureNamespace.Task : FrameGraphTextureNamespace.Graph,\r\n handle\r\n );\r\n }\r\n\r\n /**\r\n * Creates a (frame graph) render target wrapper\r\n * Note that renderTargets or renderTargetDepth can be undefined, but not both at the same time!\r\n * @param name Name of the render target wrapper\r\n * @param renderTargets Render target handles (textures) to use\r\n * @param renderTargetDepth Render target depth handle (texture) to use\r\n * @param depthReadOnly If true, the depth buffer will be read-only\r\n * @param stencilReadOnly If true, the stencil buffer will be read-only\r\n * @returns The created render target wrapper\r\n */\r\n public createRenderTarget(\r\n name: string,\r\n renderTargets?: FrameGraphTextureHandle | FrameGraphTextureHandle[],\r\n renderTargetDepth?: FrameGraphTextureHandle,\r\n depthReadOnly?: boolean,\r\n stencilReadOnly?: boolean\r\n ): FrameGraphRenderTarget {\r\n const renderTarget = new FrameGraphRenderTarget(name, this, renderTargets, renderTargetDepth);\r\n\r\n const rtw = renderTarget.renderTargetWrapper;\r\n\r\n if (rtw !== undefined) {\r\n rtw.depthReadOnly = !!depthReadOnly;\r\n rtw.stencilReadOnly = !!stencilReadOnly;\r\n\r\n if (renderTargets) {\r\n const handles = Array.isArray(renderTargets) ? renderTargets : [renderTargets];\r\n\r\n for (let i = 0; i < handles.length; i++) {\r\n let handle = handles[i];\r\n handle = this._textures.get(handle)?.refHandle ?? handle;\r\n\r\n const historyEntry = this._historyTextures.get(handle);\r\n if (historyEntry) {\r\n historyEntry.references.push({ renderTargetWrapper: rtw, textureIndex: i });\r\n\r\n rtw.setTexture(historyEntry.textures[historyEntry.index]!, i, false);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return renderTarget;\r\n }\r\n\r\n /**\r\n * Creates a handle which is not associated with any texture.\r\n * Call resolveDanglingHandle to associate the handle with a valid texture handle.\r\n * @returns The dangling handle\r\n */\r\n public createDanglingHandle() {\r\n return FrameGraphTextureManager._Counter++;\r\n }\r\n\r\n /**\r\n * Associates a texture with a dangling handle\r\n * @param danglingHandle The dangling handle\r\n * @param handle The handle to associate with the dangling handle (if not provided, a new texture handle will be created, using the newTextureName and creationOptions parameters)\r\n * @param newTextureName The name of the new texture to create (if handle is not provided)\r\n * @param creationOptions The options to use when creating the new texture (if handle is not provided)\r\n */\r\n public resolveDanglingHandle(\r\n danglingHandle: FrameGraphTextureHandle,\r\n handle?: FrameGraphTextureHandle,\r\n newTextureName?: string,\r\n creationOptions?: FrameGraphTextureCreationOptions\r\n ) {\r\n if (handle === undefined) {\r\n if (newTextureName === undefined || creationOptions === undefined) {\r\n throw new Error(\"resolveDanglingHandle: Either handle or newTextureName and creationOptions must be provided.\");\r\n }\r\n this.createRenderTargetTexture(newTextureName, creationOptions, danglingHandle);\r\n return;\r\n }\r\n\r\n const textureEntry = this._textures.get(handle);\r\n\r\n if (textureEntry === undefined) {\r\n throw new Error(`resolveDanglingHandle: Handle ${handle} does not exist!`);\r\n }\r\n\r\n handle = textureEntry.refHandle ?? handle; // gets the refHandle if handle is a (resolved) dangling handle itself\r\n\r\n this._textures.set(danglingHandle, {\r\n texture: textureEntry.texture,\r\n refHandle: handle,\r\n name: textureEntry.name,\r\n creationOptions: {\r\n size: { ...(textureEntry.creationOptions.size as { width: number; height: number; depth?: number; layers?: number }) },\r\n options: FrameGraphTextureManager.CloneTextureOptions(textureEntry.creationOptions.options),\r\n sizeIsPercentage: textureEntry.creationOptions.sizeIsPercentage,\r\n isHistoryTexture: false,\r\n },\r\n namespace: textureEntry.namespace,\r\n textureIndex: textureEntry.textureIndex,\r\n });\r\n }\r\n\r\n /**\r\n * Gets the absolute dimensions of a texture.\r\n * @param size The size of the texture. Width and height must be expressed as a percentage of the screen size (100=100%)!\r\n * @param screenWidth The width of the screen (default: the width of the rendering canvas)\r\n * @param screenHeight The height of the screen (default: the height of the rendering canvas)\r\n * @returns The absolute dimensions of the texture\r\n */\r\n public getAbsoluteDimensions(size: TextureSize, screenWidth?: number, screenHeight?: number): { width: number; height: number } {\r\n const backbufferColorTextureSize = this._textures.get(backbufferColorTextureHandle)!.creationOptions.size as { width: number; height: number };\r\n\r\n screenWidth = backbufferColorTextureSize.width;\r\n screenHeight = backbufferColorTextureSize.height;\r\n\r\n const { width, height } = getDimensionsFromTextureSize(size);\r\n\r\n return {\r\n width: Math.floor((width * screenWidth) / 100),\r\n height: Math.floor((height * screenHeight) / 100),\r\n };\r\n }\r\n\r\n /**\r\n * Calculates the total byte size of all textures used by the frame graph texture manager (including external textures)\r\n * @param optimizedSize True if the calculation should not factor in aliased textures\r\n * @param outputWidth The output width of the frame graph. Will be used to calculate the size of percentage-based textures\r\n * @param outputHeight The output height of the frame graph. Will be used to calculate the size of percentage-based textures\r\n * @returns The total size of all textures\r\n */\r\n public computeTotalTextureSize(optimizedSize: boolean, outputWidth: number, outputHeight: number) {\r\n let totalSize = 0;\r\n\r\n this._textures.forEach((entry, handle) => {\r\n if (\r\n (!this._backBufferTextureOverriden && (handle === backbufferColorTextureHandle || handle === backbufferDepthStencilTextureHandle)) ||\r\n entry.refHandle !== undefined\r\n ) {\r\n return;\r\n }\r\n if (optimizedSize && entry.aliasHandle !== undefined) {\r\n return;\r\n }\r\n\r\n const options = entry.creationOptions;\r\n const textureIndex = entry.textureIndex || 0;\r\n const dimensions = options.sizeIsPercentage ? this.getAbsoluteDimensions(options.size, outputWidth, outputHeight) : getDimensionsFromTextureSize(options.size);\r\n\r\n const blockInfo = FrameGraphTextureManager._GetTextureBlockInformation(\r\n options.options.types?.[textureIndex] ?? Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n options.options.formats![textureIndex]\r\n );\r\n\r\n const textureByteSize = Math.ceil(dimensions.width / blockInfo.width) * Math.ceil(dimensions.height / blockInfo.height) * blockInfo.length;\r\n\r\n let byteSize = textureByteSize;\r\n\r\n if (options.options.createMipMaps) {\r\n byteSize = Math.floor((byteSize * 4) / 3);\r\n }\r\n\r\n if ((options.options.samples || 1) > 1) {\r\n // We need an additional texture in the case of MSAA\r\n byteSize += textureByteSize;\r\n }\r\n\r\n totalSize += byteSize;\r\n });\r\n\r\n return totalSize;\r\n }\r\n\r\n /**\r\n * True if the back buffer texture has been overriden by a call to setBackBufferTexture\r\n */\r\n public get backBufferTextureOverriden() {\r\n return this._backBufferTextureOverriden;\r\n }\r\n\r\n /**\r\n * Overrides the default back buffer color/depth-stencil textures used by the frame graph.\r\n * Note that if both textureCreationOptions and depthStencilTextureCreationOptions are provided,\r\n * the engine will use them to create the back buffer color and depth/stencil textures respectively.\r\n * In that case, width and height are ignored.\r\n * @param width The width of the back buffer color/depth-stencil texture (if 0, the engine's current back buffer color/depth-stencil texture width will be used)\r\n * @param height The height of the back buffer color/depth-stencil texture (if 0, the engine's current back buffer color/depth-stencil texture height will be used)\r\n * @param textureCreationOptions The color texture creation options (optional)\r\n * @param depthStencilTextureCreationOptions The depth/stencil texture creation options (optional)\r\n */\r\n public setBackBufferTextures(\r\n width: number,\r\n height: number,\r\n textureCreationOptions?: FrameGraphTextureCreationOptions,\r\n depthStencilTextureCreationOptions?: FrameGraphTextureCreationOptions\r\n ) {\r\n if ((width === 0 || height === 0) && (!textureCreationOptions || !depthStencilTextureCreationOptions)) {\r\n if (this._backBufferTextureOverriden) {\r\n let entry = this._textures.get(backbufferColorTextureHandle)!;\r\n\r\n entry.texture?.dispose();\r\n entry.texture = null;\r\n entry.debug?.dispose();\r\n entry.debug = undefined;\r\n\r\n entry = this._textures.get(backbufferDepthStencilTextureHandle)!;\r\n entry.texture?.dispose();\r\n entry.texture = null;\r\n entry.debug?.dispose();\r\n entry.debug = undefined;\r\n }\r\n\r\n this._backBufferTextureEntry = null;\r\n this._backBufferDepthStencilTextureEntry = null;\r\n this._backBufferTextureOverriden = false;\r\n\r\n this._addSystemTextures();\r\n return;\r\n }\r\n\r\n this._backBufferTextureOverriden = true;\r\n\r\n const size = { width, height };\r\n\r\n this._backBufferTextureEntry = {\r\n name: \"backbuffer color\",\r\n texture: null,\r\n creationOptions: textureCreationOptions ?? {\r\n size,\r\n options: {\r\n createMipMaps: false,\r\n samples: this.engine.getCreationOptions().antialias ? 4 : 1,\r\n types: [Constants.TEXTURETYPE_UNSIGNED_BYTE],\r\n formats: [Constants.TEXTUREFORMAT_RGBA],\r\n useSRGBBuffers: [false],\r\n creationFlags: [0],\r\n labels: [\"backbuffer color\"],\r\n },\r\n sizeIsPercentage: false,\r\n },\r\n namespace: FrameGraphTextureNamespace.Graph,\r\n lifespan: {\r\n firstTask: Number.MAX_VALUE,\r\n lastTask: 0,\r\n },\r\n };\r\n this._backBufferTextureEntry.textureDescriptionHash = this._createTextureDescriptionHash(this._backBufferTextureEntry.creationOptions);\r\n\r\n this._backBufferDepthStencilTextureEntry = {\r\n name: \"backbuffer depth/stencil\",\r\n texture: null,\r\n creationOptions: depthStencilTextureCreationOptions ?? {\r\n size,\r\n options: {\r\n createMipMaps: false,\r\n samples: this.engine.getCreationOptions().antialias ? 4 : 1,\r\n types: [Constants.TEXTURETYPE_UNSIGNED_BYTE],\r\n formats: [this.engine.isStencilEnable ? Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 : Constants.TEXTUREFORMAT_DEPTH32_FLOAT],\r\n useSRGBBuffers: [false],\r\n creationFlags: [0],\r\n labels: [\"backbuffer depth/stencil\"],\r\n },\r\n sizeIsPercentage: false,\r\n },\r\n namespace: FrameGraphTextureNamespace.Graph,\r\n lifespan: {\r\n firstTask: Number.MAX_VALUE,\r\n lastTask: 0,\r\n },\r\n };\r\n this._backBufferDepthStencilTextureEntry.textureDescriptionHash = this._createTextureDescriptionHash(this._backBufferDepthStencilTextureEntry.creationOptions);\r\n\r\n this._addSystemTextures();\r\n }\r\n\r\n /**\r\n * Resets the back buffer color/depth-stencil textures to the default (the engine's current back buffer textures)\r\n * It has no effect if setBackBufferTextures has not been called before.\r\n */\r\n public resetBackBufferTextures() {\r\n this.setBackBufferTextures(0, 0);\r\n }\r\n\r\n /**\r\n * Returns true if the texture manager has at least one history texture\r\n */\r\n public get hasHistoryTextures() {\r\n return this._historyTextures.size > 0;\r\n }\r\n\r\n /** @internal */\r\n public _dispose(): void {\r\n this._releaseTextures();\r\n }\r\n\r\n /** @internal */\r\n public _allocateTextures(tasks?: FrameGraphTask[]): void {\r\n if (tasks) {\r\n this._optimizeTextureAllocation(tasks);\r\n }\r\n\r\n this._textures.forEach((entry) => {\r\n if (!entry.texture) {\r\n if (entry.refHandle !== undefined) {\r\n // entry is a dangling handle which has been resolved to point to refHandle\r\n // We simply update the texture to point to the refHandle texture\r\n const refEntry = this._textures.get(entry.refHandle)!;\r\n\r\n entry.texture = refEntry.texture;\r\n entry.texture?.incrementReferences();\r\n\r\n if (refEntry.refHandle === backbufferColorTextureHandle) {\r\n entry.refHandle = backbufferColorTextureHandle;\r\n }\r\n if (refEntry.refHandle === backbufferDepthStencilTextureHandle) {\r\n entry.refHandle = backbufferDepthStencilTextureHandle;\r\n }\r\n } else if (entry.namespace !== FrameGraphTextureNamespace.External) {\r\n if (entry.aliasHandle !== undefined) {\r\n const aliasEntry = this._textures.get(entry.aliasHandle)!;\r\n\r\n entry.texture = aliasEntry.texture!;\r\n entry.texture.incrementReferences();\r\n } else {\r\n const creationOptions = entry.creationOptions;\r\n const size = creationOptions.sizeIsPercentage ? this.getAbsoluteDimensions(creationOptions.size) : creationOptions.size;\r\n const textureIndex = entry.textureIndex || 0;\r\n\r\n const internalTextureCreationOptions: InternalTextureCreationOptions = {\r\n createMipMaps: creationOptions.options.createMipMaps,\r\n samples: creationOptions.options.samples,\r\n type: creationOptions.options.types?.[textureIndex],\r\n format: creationOptions.options.formats?.[textureIndex],\r\n useSRGBBuffer: creationOptions.options.useSRGBBuffers?.[textureIndex],\r\n creationFlags: creationOptions.options.creationFlags?.[textureIndex],\r\n label: creationOptions.options.labels?.[textureIndex] ?? `${entry.name}${textureIndex > 0 ? \"#\" + textureIndex : \"\"}`,\r\n samplingMode: Constants.TEXTURE_NEAREST_SAMPLINGMODE,\r\n createMSAATexture: creationOptions.options.samples! > 1,\r\n };\r\n\r\n const isDepthTexture = IsDepthTexture(internalTextureCreationOptions.format!);\r\n const hasStencil = HasStencilAspect(internalTextureCreationOptions.format!);\r\n const source =\r\n isDepthTexture && hasStencil\r\n ? InternalTextureSource.DepthStencil\r\n : isDepthTexture || hasStencil\r\n ? InternalTextureSource.Depth\r\n : InternalTextureSource.RenderTarget;\r\n\r\n const internalTexture = this.engine._createInternalTexture(size, internalTextureCreationOptions, false, source);\r\n\r\n if (isDepthTexture) {\r\n internalTexture.type = GetTypeForDepthTexture(internalTexture.format);\r\n }\r\n\r\n entry.texture = internalTexture;\r\n }\r\n }\r\n }\r\n\r\n if (entry.texture && entry.refHandle === undefined) {\r\n entry.debug?.dispose();\r\n entry.debug = this._createDebugTexture(entry.name, entry.texture);\r\n }\r\n });\r\n\r\n this._historyTextures.forEach((entry) => {\r\n for (let i = 0; i < entry.handles.length; i++) {\r\n entry.textures[i] = this._textures.get(entry.handles[i])!.texture;\r\n }\r\n });\r\n }\r\n\r\n /** @internal */\r\n public _releaseTextures(releaseAll = true): void {\r\n this._textures.forEach((entry, handle) => {\r\n if (entry.lifespan) {\r\n entry.lifespan.firstTask = Number.MAX_VALUE;\r\n entry.lifespan.lastTask = 0;\r\n }\r\n\r\n entry.aliasHandle = undefined;\r\n\r\n if (releaseAll || entry.namespace !== FrameGraphTextureNamespace.External) {\r\n entry.debug?.dispose();\r\n entry.debug = undefined;\r\n }\r\n\r\n if (entry.namespace === FrameGraphTextureNamespace.External) {\r\n return;\r\n }\r\n\r\n // We dispose of \"Graph\" and \"Task\" textures:\r\n // - \"Graph\" textures will be recreated by _allocateTextures because the entry still exists in this._textures, but entry.texture is null\r\n // - \"Task\" textures will be re-added to this._textures when the task is recorded (by a call to FrameGraph.build): that's why we delete the entry from this._textures below\r\n entry.texture?.dispose();\r\n entry.texture = null;\r\n\r\n if (releaseAll || entry.namespace === FrameGraphTextureNamespace.Task) {\r\n this._textures.delete(handle);\r\n this._historyTextures.delete(handle);\r\n }\r\n });\r\n\r\n this._historyTextures.forEach((entry) => {\r\n for (let i = 0; i < entry.handles.length; i++) {\r\n entry.textures[i] = null;\r\n }\r\n });\r\n\r\n if (releaseAll) {\r\n this._textures.clear();\r\n this._historyTextures.clear();\r\n this._addSystemTextures();\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _updateHistoryTextures(): void {\r\n this._historyTextures.forEach((entry) => {\r\n entry.index = entry.index ^ 1;\r\n const currentTexture = entry.textures[entry.index];\r\n if (currentTexture) {\r\n for (const { renderTargetWrapper, textureIndex } of entry.references) {\r\n renderTargetWrapper.setTexture(currentTexture, textureIndex, false);\r\n }\r\n }\r\n });\r\n }\r\n\r\n private _addSystemTextures() {\r\n const size = { width: this.engine.getRenderWidth(true), height: this.engine.getRenderHeight(true) };\r\n\r\n this._textures.set(\r\n backbufferColorTextureHandle,\r\n this._backBufferTextureEntry ?? {\r\n name: \"backbuffer color\",\r\n texture: null,\r\n creationOptions: {\r\n size,\r\n options: {\r\n createMipMaps: false,\r\n samples: this.engine.getCreationOptions().antialias ? 4 : 1,\r\n types: [Constants.TEXTURETYPE_UNSIGNED_BYTE], // todo? get from engine\r\n formats: [Constants.TEXTUREFORMAT_RGBA], // todo? get from engine\r\n useSRGBBuffers: [false],\r\n creationFlags: [0],\r\n labels: [\"backbuffer color\"],\r\n },\r\n sizeIsPercentage: false,\r\n },\r\n namespace: FrameGraphTextureNamespace.External,\r\n }\r\n );\r\n\r\n this._textures.set(\r\n backbufferDepthStencilTextureHandle,\r\n this._backBufferDepthStencilTextureEntry ?? {\r\n name: \"backbuffer depth/stencil\",\r\n texture: null,\r\n creationOptions: {\r\n size,\r\n options: {\r\n createMipMaps: false,\r\n samples: this.engine.getCreationOptions().antialias ? 4 : 1,\r\n types: [Constants.TEXTURETYPE_UNSIGNED_BYTE], // todo? get from engine\r\n formats: [Constants.TEXTUREFORMAT_DEPTH24], // todo? get from engine\r\n useSRGBBuffers: [false],\r\n creationFlags: [0],\r\n labels: [\"backbuffer depth/stencil\"],\r\n },\r\n sizeIsPercentage: false,\r\n },\r\n namespace: FrameGraphTextureNamespace.External,\r\n }\r\n );\r\n }\r\n\r\n private _createDebugTexture(name: string, texture: InternalTexture): Texture | undefined {\r\n if (!this._debugTextures) {\r\n return;\r\n }\r\n\r\n const textureDebug = new Texture(null, this._scene);\r\n\r\n textureDebug.name = name;\r\n textureDebug._texture = texture;\r\n textureDebug._texture.incrementReferences();\r\n\r\n return textureDebug;\r\n }\r\n\r\n private _freeEntry(handle: number): void {\r\n const entry = this._textures.get(handle);\r\n\r\n if (entry) {\r\n entry.debug?.dispose();\r\n this._textures.delete(handle);\r\n }\r\n }\r\n\r\n private _createHandleForTexture(\r\n name: string,\r\n texture: Nullable<InternalTexture>,\r\n creationOptions: FrameGraphTextureCreationOptions,\r\n namespace: FrameGraphTextureNamespace,\r\n handle?: FrameGraphTextureHandle,\r\n textureIndex?: number\r\n ): FrameGraphTextureHandle {\r\n handle = handle ?? FrameGraphTextureManager._Counter++;\r\n textureIndex = textureIndex || 0;\r\n\r\n const textureName = creationOptions.isHistoryTexture ? `${name} ping` : name;\r\n\r\n let label = creationOptions.options.labels?.[textureIndex] ?? \"\";\r\n if (label === textureName) {\r\n label = \"\";\r\n }\r\n\r\n const textureEntry: TextureEntry = {\r\n texture,\r\n name: `${textureName}${label ? \" \" + label : \"\"}`,\r\n creationOptions: {\r\n size: textureSizeIsObject(creationOptions.size) ? creationOptions.size : { width: creationOptions.size, height: creationOptions.size },\r\n options: creationOptions.options,\r\n sizeIsPercentage: creationOptions.sizeIsPercentage,\r\n isHistoryTexture: creationOptions.isHistoryTexture,\r\n },\r\n namespace,\r\n textureIndex,\r\n textureDescriptionHash: this._createTextureDescriptionHash(creationOptions),\r\n lifespan: {\r\n firstTask: Number.MAX_VALUE,\r\n lastTask: 0,\r\n },\r\n };\r\n\r\n this._textures.set(handle, textureEntry);\r\n\r\n if (namespace === FrameGraphTextureNamespace.External) {\r\n return handle;\r\n }\r\n\r\n if (creationOptions.isHistoryTexture) {\r\n const pongCreationOptions: FrameGraphTextureCreationOptions = {\r\n size: { ...(textureEntry.creationOptions.size as { width: number; height: number }) },\r\n options: { ...textureEntry.creationOptions.options },\r\n sizeIsPercentage: textureEntry.creationOptions.sizeIsPercentage,\r\n isHistoryTexture: false,\r\n };\r\n\r\n const pongTexture = this._createHandleForTexture(`${name} pong`, null, pongCreationOptions, namespace);\r\n\r\n this._historyTextures.set(handle, { textures: [null, null], handles: [handle, pongTexture], index: 0, references: [] });\r\n\r\n return handle;\r\n }\r\n\r\n if (creationOptions.options.types && creationOptions.options.types.length > 1 && textureIndex === 0) {\r\n const textureCount = creationOptions.options.types.length;\r\n const creationOptionsForTexture: FrameGraphTextureCreationOptions = {\r\n size: textureSizeIsObject(creationOptions.size) ? creationOptions.size : { width: creationOptions.size, height: creationOptions.size },\r\n options: creationOptions.options,\r\n sizeIsPercentage: creationOptions.sizeIsPercentage,\r\n };\r\n\r\n for (let i = 1; i < textureCount; i++) {\r\n this._createHandleForTexture(textureName, null, creationOptionsForTexture, namespace, handle + i, i);\r\n }\r\n\r\n FrameGraphTextureManager._Counter += textureCount - 1;\r\n }\r\n\r\n return handle;\r\n }\r\n\r\n private _createTextureDescriptionHash(options: FrameGraphTextureCreationOptions): string {\r\n const hash: string[] = [];\r\n\r\n hash.push(textureSizeIsObject(options.size) ? `${options.size.width}_${options.size.height}` : `${options.size}`);\r\n hash.push(options.sizeIsPercentage ? \"%\" : \"A\");\r\n hash.push(options.options.createMipMaps ? \"M\" : \"N\");\r\n hash.push(options.options.samples ? `${options.options.samples}` : \"S1\");\r\n hash.push(options.options.types ? options.options.types.join(\"_\") : `${Constants.TEXTURETYPE_UNSIGNED_BYTE}`);\r\n hash.push(options.options.formats ? options.options.formats.join(\"_\") : `${Constants.TEXTUREFORMAT_RGBA}`);\r\n hash.push(options.options.useSRGBBuffers ? options.options.useSRGBBuffers.join(\"_\") : \"false\");\r\n hash.push(options.options.creationFlags ? options.options.creationFlags.join(\"_\") : \"0\");\r\n\r\n return hash.join(\"_\");\r\n }\r\n\r\n private _optimizeTextureAllocation(tasks: FrameGraphTask[]): void {\r\n this._computeTextureLifespan(tasks);\r\n\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(`================== Optimization of texture allocation ==================`);\r\n }\r\n\r\n const cache: Map<string, Array<[FrameGraphTextureHandle, Array<TextureLifespan>]>> = new Map();\r\n\r\n const iterator = this._textures.keys();\r\n for (let key = iterator.next(); key.done !== true; key = iterator.next()) {\r\n const textureHandle = key.value;\r\n const textureEntry = this._textures.get(textureHandle)!;\r\n if (textureEntry.refHandle !== undefined || textureEntry.namespace === FrameGraphTextureNamespace.External || this._historyTextures.has(textureHandle)) {\r\n continue;\r\n }\r\n\r\n const textureHash = textureEntry.textureDescriptionHash!;\r\n const textureLifespan = textureEntry.lifespan!;\r\n\r\n const cacheEntries = cache.get(textureHash);\r\n if (cacheEntries) {\r\n let cacheEntryFound = false;\r\n for (const cacheEntry of cacheEntries) {\r\n const [sourceHandle, lifespanArray] = cacheEntry;\r\n\r\n let overlapped = false;\r\n for (const lifespan of lifespanArray) {\r\n if (lifespan.firstTask <= textureLifespan.lastTask && lifespan.lastTask >= textureLifespan.firstTask) {\r\n overlapped = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!overlapped) {\r\n // No overlap between texture lifespan and all lifespans in the array, this texture can reuse the same entry cache\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(`Texture ${textureHandle} (${textureEntry.name}) reuses cache entry ${sourceHandle}`);\r\n }\r\n\r\n lifespanArray.push(textureLifespan);\r\n textureEntry.aliasHandle = sourceHandle;\r\n cacheEntryFound = true;\r\n break;\r\n }\r\n }\r\n if (!cacheEntryFound) {\r\n cacheEntries.push([textureHandle, [textureLifespan]]);\r\n }\r\n } else {\r\n cache.set(textureHash, [[textureHandle, [textureLifespan]]]);\r\n }\r\n }\r\n }\r\n\r\n // Loop through all task/pass dependencies and compute the lifespan of each texture (that is, the first task/pass that uses it and the last task/pass that uses it)\r\n private _computeTextureLifespan(tasks: FrameGraphTask[]): void {\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(`================== Dump of texture dependencies for all tasks/passes ==================`);\r\n }\r\n\r\n for (let t = 0; t < tasks.length; ++t) {\r\n const task = tasks[t];\r\n\r\n if (task.passes.length > 0) {\r\n this._computeTextureLifespanForPasses(task, t, task.passes);\r\n }\r\n\r\n if (task.passesDisabled.length > 0) {\r\n this._computeTextureLifespanForPasses(task, t, task.passesDisabled);\r\n }\r\n\r\n if (task.dependencies) {\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(`task#${t} (${task.name}), global dependencies`);\r\n }\r\n\r\n this._updateLifespan(t * 100 + 99, task.dependencies);\r\n }\r\n }\r\n\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(`================== Texture lifespans ==================`);\r\n const iterator = this._textures.keys();\r\n for (let key = iterator.next(); key.done !== true; key = iterator.next()) {\r\n const textureHandle = key.value;\r\n const textureEntry = this._textures.get(textureHandle)!;\r\n if (textureEntry.refHandle !== undefined || textureEntry.namespace === FrameGraphTextureNamespace.External || this._historyTextures.has(textureHandle)) {\r\n continue;\r\n }\r\n Logger.Log(`${textureHandle} (${textureEntry.name}): ${textureEntry.lifespan!.firstTask} - ${textureEntry.lifespan!.lastTask}`);\r\n }\r\n }\r\n }\r\n\r\n private _computeTextureLifespanForPasses(task: FrameGraphTask, taskIndex: number, passes: IFrameGraphPass[]): void {\r\n for (let p = 0; p < passes.length; ++p) {\r\n const dependencies = new Set<FrameGraphTextureHandle>();\r\n const pass = passes[p];\r\n\r\n if (!FrameGraphRenderPass.IsRenderPass(pass)) {\r\n continue;\r\n }\r\n\r\n pass.collectDependencies(dependencies);\r\n\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(`task#${taskIndex} (${task.name}), pass#${p} (${pass.name})`);\r\n }\r\n\r\n this._updateLifespan(taskIndex * 100 + p, dependencies);\r\n }\r\n }\r\n\r\n private _updateLifespan(passOrderNum: number, dependencies: Set<FrameGraphTextureHandle>) {\r\n const iterator = dependencies.keys();\r\n for (let key = iterator.next(); key.done !== true; key = iterator.next()) {\r\n const textureHandle = key.value;\r\n if (this.isBackbuffer(textureHandle)) {\r\n continue;\r\n }\r\n let textureEntry = this._textures.get(textureHandle);\r\n if (!textureEntry) {\r\n throw new Error(`FrameGraph._computeTextureLifespan: Texture handle \"${textureHandle}\" not found in the texture manager.`);\r\n }\r\n let handle = textureHandle;\r\n while (textureEntry.refHandle !== undefined) {\r\n handle = textureEntry.refHandle;\r\n textureEntry = this._textures.get(handle);\r\n if (!textureEntry) {\r\n throw new Error(`FrameGraph._computeTextureLifespan: Texture handle \"${handle}\" not found in the texture manager (source handle=\"${textureHandle}\").`);\r\n }\r\n }\r\n if (textureEntry.namespace === FrameGraphTextureNamespace.External || this._historyTextures.has(handle)) {\r\n continue;\r\n }\r\n\r\n if (this.showDebugLogsForTextureAllcationOptimization) {\r\n Logger.Log(` ${handle} (${textureEntry.name})`);\r\n }\r\n\r\n textureEntry.lifespan!.firstTask = Math.min(textureEntry.lifespan!.firstTask, passOrderNum);\r\n textureEntry.lifespan!.lastTask = Math.max(textureEntry.lifespan!.lastTask, passOrderNum);\r\n }\r\n }\r\n\r\n /**\r\n * Clones a texture options\r\n * @param options The options to clone\r\n * @param textureIndex The index of the texture in the types, formats, etc array of FrameGraphTextureOptions. If not provided, all options are cloned.\r\n * @param preserveLabels True if the labels should be preserved (default: false)\r\n * @returns The cloned options\r\n */\r\n public static CloneTextureOptions(options: FrameGraphTextureOptions, textureIndex?: number, preserveLabels?: boolean): FrameGraphTextureOptions {\r\n return textureIndex !== undefined\r\n ? {\r\n createMipMaps: options.createMipMaps,\r\n samples: options.samples,\r\n types: options.types ? [options.types[textureIndex]] : undefined,\r\n formats: options.formats ? [options.formats[textureIndex]] : undefined,\r\n useSRGBBuffers: options.useSRGBBuffers ? [options.useSRGBBuffers[textureIndex]] : undefined,\r\n creationFlags: options.creationFlags ? [options.creationFlags[textureIndex]] : undefined,\r\n labels: options.labels ? [options.labels[textureIndex]] : undefined,\r\n }\r\n : {\r\n createMipMaps: options.createMipMaps,\r\n samples: options.samples,\r\n types: options.types ? [...options.types] : undefined,\r\n formats: options.formats ? [...options.formats] : undefined,\r\n useSRGBBuffers: options.useSRGBBuffers ? [...options.useSRGBBuffers] : undefined,\r\n creationFlags: options.creationFlags ? [...options.creationFlags] : undefined,\r\n labels: options.labels && preserveLabels ? [...options.labels] : undefined,\r\n };\r\n }\r\n\r\n /**\r\n * Gets the texture block information.\r\n * @param type Type of the texture.\r\n * @param format Format of the texture.\r\n * @returns The texture block information. You can calculate the byte size of the texture by doing: Math.ceil(width / blockInfo.width) * Math.ceil(height / blockInfo.height) * blockInfo.length\r\n */\r\n private static _GetTextureBlockInformation(type: number, format: number): { width: number; height: number; length: number } {\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_DEPTH16:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTUREFORMAT_DEPTH24:\r\n return { width: 1, height: 1, length: 3 };\r\n case Constants.TEXTUREFORMAT_DEPTH24_STENCIL8:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_DEPTH32_FLOAT:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8:\r\n return { width: 1, height: 1, length: 5 };\r\n case Constants.TEXTUREFORMAT_STENCIL8:\r\n return { width: 1, height: 1, length: 1 };\r\n\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM:\r\n return { width: 4, height: 4, length: 16 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT:\r\n return { width: 4, height: 4, length: 16 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT:\r\n return { width: 4, height: 4, length: 16 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5:\r\n return { width: 4, height: 4, length: 16 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3:\r\n return { width: 4, height: 4, length: 16 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1:\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1:\r\n return { width: 4, height: 4, length: 8 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4:\r\n return { width: 4, height: 4, length: 16 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL:\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2:\r\n return { width: 4, height: 4, length: 8 };\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC:\r\n return { width: 4, height: 4, length: 16 };\r\n }\r\n\r\n switch (type) {\r\n case Constants.TEXTURETYPE_BYTE:\r\n case Constants.TEXTURETYPE_UNSIGNED_BYTE:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_R:\r\n case Constants.TEXTUREFORMAT_R_INTEGER:\r\n case Constants.TEXTUREFORMAT_ALPHA:\r\n case Constants.TEXTUREFORMAT_LUMINANCE:\r\n case Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:\r\n return { width: 1, height: 1, length: 1 };\r\n case Constants.TEXTUREFORMAT_RG:\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTUREFORMAT_RGB:\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n return { width: 1, height: 1, length: 3 };\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return { width: 1, height: 1, length: 4 };\r\n default:\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n case Constants.TEXTURETYPE_SHORT:\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n return { width: 1, height: 1, length: 6 };\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return { width: 1, height: 1, length: 8 };\r\n default:\r\n return { width: 1, height: 1, length: 8 };\r\n }\r\n case Constants.TEXTURETYPE_INT:\r\n case Constants.TEXTURETYPE_UNSIGNED_INTEGER: // Refers to UNSIGNED_INT\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return { width: 1, height: 1, length: 8 };\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n return { width: 1, height: 1, length: 12 };\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return { width: 1, height: 1, length: 16 };\r\n default:\r\n return { width: 1, height: 1, length: 16 };\r\n }\r\n case Constants.TEXTURETYPE_FLOAT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_RG:\r\n return { width: 1, height: 1, length: 8 };\r\n case Constants.TEXTUREFORMAT_RGB:\r\n return { width: 1, height: 1, length: 12 };\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return { width: 1, height: 1, length: 16 };\r\n default:\r\n return { width: 1, height: 1, length: 16 };\r\n }\r\n case Constants.TEXTURETYPE_HALF_FLOAT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTUREFORMAT_RG:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_RGB:\r\n return { width: 1, height: 1, length: 6 };\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return { width: 1, height: 1, length: 8 };\r\n default:\r\n return { width: 1, height: 1, length: 8 };\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return { width: 1, height: 1, length: 4 };\r\n default:\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return { width: 1, height: 1, length: 4 };\r\n default:\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\r\n return { width: 1, height: 1, length: 2 };\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return { width: 1, height: 1, length: 4 };\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return { width: 1, height: 1, length: 4 };\r\n default:\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n }\r\n\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n}\r\n"]}
|
|
@@ -2,6 +2,7 @@ import type { Camera } from "../Cameras/camera.js";
|
|
|
2
2
|
import { RenderTargetTexture } from "../Materials/Textures/renderTargetTexture.js";
|
|
3
3
|
import type { IScreenshotSize } from "./interfaces/screenshotSize.js";
|
|
4
4
|
import type { AbstractEngine } from "../Engines/abstractEngine.js";
|
|
5
|
+
import type { FrameGraph } from "../FrameGraph/frameGraph.js";
|
|
5
6
|
/**
|
|
6
7
|
* Captures a screenshot of the current rendering
|
|
7
8
|
* Please note that simultaneous screenshots are not supported: you must wait until one screenshot is complete before taking another.
|
|
@@ -40,10 +41,11 @@ export declare function CreateScreenshot(engine: AbstractEngine, camera: Camera,
|
|
|
40
41
|
* @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
|
|
41
42
|
* @param useFill fill the screenshot dimensions with the render canvas and clip any overflow. If false, fit the canvas within the screenshot, as in letterboxing.
|
|
42
43
|
* @param clearWithSceneColor If true, the screenshot canvas will be cleared with the scene clear color before copying the render.
|
|
44
|
+
* @param forceDownload force the system to download the image
|
|
43
45
|
* @returns screenshot as a string of base64-encoded characters. This string can be assigned
|
|
44
46
|
* to the src parameter of an <img> to display it
|
|
45
47
|
*/
|
|
46
|
-
export declare function CreateScreenshotAsync(engine: AbstractEngine, camera: Camera, size: IScreenshotSize | number, mimeType?: string, quality?: number, useFill?: boolean, clearWithSceneColor?: boolean): Promise<string>;
|
|
48
|
+
export declare function CreateScreenshotAsync(engine: AbstractEngine, camera: Camera, size: IScreenshotSize | number, mimeType?: string, quality?: number, useFill?: boolean, clearWithSceneColor?: boolean, forceDownload?: boolean): Promise<string>;
|
|
47
49
|
/**
|
|
48
50
|
* Captures and automatically downloads a screenshot of the current rendering for a specific size. This will render the entire canvas but will generate a blink (due to canvas resize)
|
|
49
51
|
* If screenshot image data is needed, use {@link CreateScreenshotAsync} instead.
|
|
@@ -113,12 +115,41 @@ export declare function CreateScreenshotUsingRenderTarget(engine: AbstractEngine
|
|
|
113
115
|
* to the src parameter of an <img> to display it
|
|
114
116
|
*/
|
|
115
117
|
export declare function CreateScreenshotUsingRenderTargetAsync(engine: AbstractEngine, camera: Camera, size: IScreenshotSize | number, mimeType?: string, samples?: number, antialiasing?: boolean, fileName?: string, renderSprites?: boolean, enableStencilBuffer?: boolean, useLayerMask?: boolean, quality?: number, customizeTexture?: (texture: RenderTargetTexture) => void, customDumpData?: (width: number, height: number, data: ArrayBufferView, successCallback?: (data: string | ArrayBuffer) => void, mimeType?: string, fileName?: string, invertY?: boolean, toArrayBuffer?: boolean, quality?: number) => void): Promise<string>;
|
|
118
|
+
/**
|
|
119
|
+
* Generates an image screenshot from the specified frame graph and camera
|
|
120
|
+
* Please note:
|
|
121
|
+
* - that the frame graph must write to the back buffer color for this to work! This is because the back buffer color is replaced by the texture of the screenshot during the operation.
|
|
122
|
+
* - the camera is set as the camera for the main object renderer of the frame graph during the operation, and restored afterwards.
|
|
123
|
+
* This will only work if the frame graph has a main object renderer (isMainObjectRenderer is true for one of its object renderers)
|
|
124
|
+
* - that simultaneous screenshots are not supported: you must wait until one screenshot is complete before taking another.
|
|
125
|
+
* @param frameGraph The frame graph to use for rendering
|
|
126
|
+
* @param camera The camera to use for rendering
|
|
127
|
+
* @param size This parameter can be set to a single number or to an object with the
|
|
128
|
+
* following (optional) properties: precision, width, height. If a single number is passed,
|
|
129
|
+
* it will be used for both width and height. If an object is passed, the screenshot size
|
|
130
|
+
* will be derived from the parameters. The precision property is a multiplier allowing
|
|
131
|
+
* rendering at a higher or lower resolution
|
|
132
|
+
* @param mimeType The MIME type of the screenshot image (default: image/png).
|
|
133
|
+
* Check your browser for supported MIME types
|
|
134
|
+
* @param samples Texture samples (default: 1)
|
|
135
|
+
* @param antialiasing Whether antialiasing should be turned on or not (default: false)
|
|
136
|
+
* @param fileName A name for for the downloaded file.
|
|
137
|
+
* @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
|
|
138
|
+
* @param customDumpData The function to use to dump the data. If not provided, the default DumpData function will be used.
|
|
139
|
+
* @param automaticDownload If true, the screenshot will be automatically downloaded as a file instead of being returned as a string: in this case, null is returned.
|
|
140
|
+
* @param numberOfFramesToRender If provided, the number of frames to render before taking the screenshot.
|
|
141
|
+
* If not provided, the screenshot will be taken after the next frame, or after 32 frames if the frame graph has at least one history texture.
|
|
142
|
+
* @returns screenshot as a string of base64-encoded characters. This string can be assigned
|
|
143
|
+
* to the src parameter of an <img> to display it. If automaticDownload is true, null is returned instead
|
|
144
|
+
*/
|
|
145
|
+
export declare function CreateScreenshotForFrameGraphAsync(frameGraph: FrameGraph, camera: Camera, size: IScreenshotSize | number, mimeType?: string, samples?: number, antialiasing?: boolean, fileName?: string, quality?: number, customDumpData?: (width: number, height: number, data: ArrayBufferView, successCallback?: (data: string | ArrayBuffer) => void, mimeType?: string, fileName?: string, invertY?: boolean, toArrayBuffer?: boolean, quality?: number) => void, automaticDownload?: boolean, numberOfFramesToRender?: number): Promise<string | ArrayBuffer | null>;
|
|
116
146
|
/**
|
|
117
147
|
* Class containing a set of static utilities functions for screenshots
|
|
118
148
|
*/
|
|
119
149
|
export declare const ScreenshotTools: {
|
|
120
150
|
/**
|
|
121
151
|
* Captures a screenshot of the current rendering
|
|
152
|
+
* Please note that simultaneous screenshots are not supported: you must wait until one screenshot is complete before taking another.
|
|
122
153
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
|
|
123
154
|
* @param engine defines the rendering engine
|
|
124
155
|
* @param camera defines the source camera. If the camera is not the scene's active camera, {@link CreateScreenshotUsingRenderTarget} will be used instead, and `useFill` will be ignored
|
|
@@ -139,6 +170,7 @@ export declare const ScreenshotTools: {
|
|
|
139
170
|
CreateScreenshot: typeof CreateScreenshot;
|
|
140
171
|
/**
|
|
141
172
|
* Captures a screenshot of the current rendering
|
|
173
|
+
* Please note that simultaneous screenshots are not supported: you must wait until one screenshot is complete before taking another.
|
|
142
174
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
|
|
143
175
|
* @param engine defines the rendering engine
|
|
144
176
|
* @param camera defines the source camera. If the camera is not the scene's active camera, {@link CreateScreenshotUsingRenderTarget} will be used instead, and `useFill` will be ignored
|
|
@@ -151,6 +183,7 @@ export declare const ScreenshotTools: {
|
|
|
151
183
|
* Check your browser for supported MIME types
|
|
152
184
|
* @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
|
|
153
185
|
* @param useFill fill the screenshot dimensions with the render canvas and clip any overflow. If false, fit the canvas within the screenshot, as in letterboxing.
|
|
186
|
+
* @param forceDownload force the system to download the image
|
|
154
187
|
* @returns screenshot as a string of base64-encoded characters. This string can be assigned
|
|
155
188
|
* to the src parameter of an <img> to display it
|
|
156
189
|
*/
|
|
@@ -158,6 +191,7 @@ export declare const ScreenshotTools: {
|
|
|
158
191
|
/**
|
|
159
192
|
* Captures and automatically downloads a screenshot of the current rendering for a specific size. This will render the entire canvas but will generate a blink (due to canvas resize)
|
|
160
193
|
* If screenshot image data is needed, use {@link CreateScreenshotAsync} instead.
|
|
194
|
+
* Please note that simultaneous screenshots are not supported: you must wait until one screenshot is complete before taking another.
|
|
161
195
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
|
|
162
196
|
* @param engine defines the rendering engine
|
|
163
197
|
* @param camera defines the source camera. If the camera is not the scene's active camera, {@link CreateScreenshotUsingRenderTarget} will be used instead, and `useFill` will be ignored
|
|
@@ -172,6 +206,7 @@ export declare const ScreenshotTools: {
|
|
|
172
206
|
CreateScreenshotWithResizeAsync: typeof CreateScreenshotWithResizeAsync;
|
|
173
207
|
/**
|
|
174
208
|
* Generates an image screenshot from the specified camera.
|
|
209
|
+
* Please note that simultaneous screenshots are not supported: you must wait until one screenshot is complete before taking another.
|
|
175
210
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
|
|
176
211
|
* @param engine The engine to use for rendering
|
|
177
212
|
* @param camera The camera to use for rendering
|
|
@@ -195,6 +230,7 @@ export declare const ScreenshotTools: {
|
|
|
195
230
|
CreateScreenshotUsingRenderTarget: typeof CreateScreenshotUsingRenderTarget;
|
|
196
231
|
/**
|
|
197
232
|
* Generates an image screenshot from the specified camera.
|
|
233
|
+
* Please note that simultaneous screenshots are not supported: you must wait until one screenshot is complete before taking another.
|
|
198
234
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
|
|
199
235
|
* @param engine The engine to use for rendering
|
|
200
236
|
* @param camera The camera to use for rendering
|
|
@@ -214,4 +250,30 @@ export declare const ScreenshotTools: {
|
|
|
214
250
|
* to the src parameter of an <img> to display it
|
|
215
251
|
*/
|
|
216
252
|
CreateScreenshotUsingRenderTargetAsync: typeof CreateScreenshotUsingRenderTargetAsync;
|
|
253
|
+
/**
|
|
254
|
+
* Generates an image screenshot from the specified frame graph and camera
|
|
255
|
+
* Please note:
|
|
256
|
+
* - that the frame graph must write to the back buffer color for this to work! This is because the back buffer color is replaced by the texture of the screenshot during the operation.
|
|
257
|
+
* - the camera is set as the camera for the main object renderer of the frame graph during the operation, and restored afterwards.
|
|
258
|
+
* This will only work if the frame graph has a main object renderer (isMainObjectRenderer is true for one of its object renderers)
|
|
259
|
+
* - that simultaneous screenshots are not supported: you must wait until one screenshot is complete before taking another.
|
|
260
|
+
* @param frameGraph The frame graph to use for rendering
|
|
261
|
+
* @param camera The camera to use for rendering
|
|
262
|
+
* @param size This parameter can be set to a single number or to an object with the
|
|
263
|
+
* following (optional) properties: precision, width, height. If a single number is passed,
|
|
264
|
+
* it will be used for both width and height. If an object is passed, the screenshot size
|
|
265
|
+
* will be derived from the parameters. The precision property is a multiplier allowing
|
|
266
|
+
* rendering at a higher or lower resolution
|
|
267
|
+
* @param mimeType The MIME type of the screenshot image (default: image/png).
|
|
268
|
+
* Check your browser for supported MIME types
|
|
269
|
+
* @param samples Texture samples (default: 1)
|
|
270
|
+
* @param antialiasing Whether antialiasing should be turned on or not (default: false)
|
|
271
|
+
* @param fileName A name for for the downloaded file.
|
|
272
|
+
* @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
|
|
273
|
+
* @param customDumpData The function to use to dump the data. If not provided, the default DumpData function will be used.
|
|
274
|
+
* @param automaticDownload If true, the screenshot will be automatically downloaded as a file instead of being returned as a string: in this case, null is returned.
|
|
275
|
+
* @returns screenshot as a string of base64-encoded characters. This string can be assigned
|
|
276
|
+
* to the src parameter of an <img> to display it. If automaticDownload is true, null is returned instead
|
|
277
|
+
*/
|
|
278
|
+
CreateScreenshotForFrameGraphAsync: typeof CreateScreenshotForFrameGraphAsync;
|
|
217
279
|
};
|