@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
115 lines (114 loc) • 3.53 kB
TypeScript
/**
* A WebGPU implementation of the RenderTarget.
*
* @ignore
*/
export class WebgpuRenderTarget {
/**
* @param {import('../render-target.js').RenderTarget} renderTarget - The render target owning
* this implementation.
*/
constructor(renderTarget: import("../render-target.js").RenderTarget);
/** @type {boolean} */
initialized: boolean;
/**
* Unique key used by render pipeline creation
*
* @type {number}
*/
key: number;
/** @type {ColorAttachment[]} */
colorAttachments: ColorAttachment[];
/**
* @type {GPUTextureFormat}
* @private
*/
private depthFormat;
/** @type {boolean} */
hasStencil: boolean;
/**
* @type {GPUTexture}
* @private
*/
private depthTexture;
/**
* True if the depthTexture is internally allocated / owned
*
* @type {boolean}
*/
depthTextureInternal: boolean;
/**
* Texture assigned each frame, and not owned by this render target. This is used on the
* framebuffer to assign per frame texture obtained from the context.
*
* @type {GPUTexture}
* @private
*/
private assignedColorTexture;
/**
* Render pass descriptor used when starting a render pass for this render target.
*
* @type {GPURenderPassDescriptor}
* @private
*/
private renderPassDescriptor;
renderTarget: import("../render-target.js").RenderTarget;
/**
* Release associated resources. Note that this needs to leave this instance in a state where
* it can be re-initialized again, which is used by render target resizing.
*
* @param {import('../webgpu/webgpu-graphics-device.js').WebgpuGraphicsDevice} device - The
* graphics device.
*/
destroy(device: import("../webgpu/webgpu-graphics-device.js").WebgpuGraphicsDevice): void;
updateKey(): void;
setDepthFormat(depthFormat: any): void;
/**
* Assign a color buffer. This allows the color buffer of the main framebuffer
* to be swapped each frame to a buffer provided by the context.
*
* @param {any} gpuTexture - The color buffer.
*/
assignColorTexture(gpuTexture: any): void;
setColorAttachment(index: any, multisampledBuffer: any, format: any): void;
/**
* Initialize render target for rendering one time.
*
* @param {import('../webgpu/webgpu-graphics-device.js').WebgpuGraphicsDevice} device - The
* graphics device.
* @param {import('../render-target.js').RenderTarget} renderTarget - The render target.
*/
init(device: import("../webgpu/webgpu-graphics-device.js").WebgpuGraphicsDevice, renderTarget: import("../render-target.js").RenderTarget): void;
initDepthStencil(wgpu: any, renderTarget: any): void;
/**
* @private
*/
private initColor;
/**
* Update WebGPU render pass descriptor by RenderPass settings.
*
* @param {import('../render-pass.js').RenderPass} renderPass - The render pass to start.
*/
setupForRenderPass(renderPass: import("../render-pass.js").RenderPass): void;
loseContext(): void;
resolve(device: any, target: any, color: any, depth: any): void;
}
/**
* Private class storing info about color buffer.
*
* @ignore
*/
declare class ColorAttachment {
/**
* @type {GPUTextureFormat}
* @private
*/
private format;
/**
* @type {GPUTexture}
* @private
*/
private multisampledBuffer;
destroy(): void;
}
export {};