@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
72 lines (71 loc) • 2.45 kB
TypeScript
/**
* A WebGPU implementation of the Texture.
*
* @ignore
*/
export class WebgpuTexture {
constructor(texture: any);
/**
* @type {GPUTexture}
* @private
*/
private gpuTexture;
/**
* @type {GPUTextureView}
* @private
*/
private view;
/**
* An array of samplers, addressed by SAMPLETYPE_*** constant, allowing texture to be sampled
* using different samplers. Most textures are sampled as interpolated floats, but some can
* additionally be sampled using non-interpolated floats (raw data) or compare sampling
* (shadow maps).
*
* @type {GPUSampler[]}
* @private
*/
private samplers;
/**
* @type {GPUTextureDescriptor}
* @private
*/
private descr;
/**
* @type {GPUTextureFormat}
* @private
*/
private format;
/** @type {import('../texture.js').Texture} */
texture: import("../texture.js").Texture;
create(device: any): void;
destroy(device: any): void;
propertyChanged(flag: any): void;
/**
* @param {any} device - The Graphics Device.
* @returns {any} - Returns the view.
*/
getView(device: any): any;
createView(viewDescr: any): any;
/**
* @param {any} device - The Graphics Device.
* @param {number} [sampleType] - A sample type for the sampler, SAMPLETYPE_*** constant. If not
* specified, the sampler type is based on the texture format / texture sampling type.
* @returns {any} - Returns the sampler.
*/
getSampler(device: any, sampleType?: number): any;
loseContext(): void;
/**
* @param {import('./webgpu-graphics-device.js').WebgpuGraphicsDevice} device - The graphics
* device.
* @param {import('../texture.js').Texture} texture - The texture.
*/
uploadImmediate(device: import("./webgpu-graphics-device.js").WebgpuGraphicsDevice, texture: import("../texture.js").Texture): void;
/**
* @param {import('./webgpu-graphics-device.js').WebgpuGraphicsDevice} device - The graphics
* device.
*/
uploadData(device: import("./webgpu-graphics-device.js").WebgpuGraphicsDevice): void;
isExternalImage(image: any): image is OffscreenCanvas | ImageBitmap | HTMLCanvasElement | HTMLVideoElement;
uploadExternalImage(device: any, image: any, mipLevel: any, index: any): void;
uploadTypedArrayData(device: any, data: any, mipLevel: any, index: any): void;
}