playcanvas
Version:
PlayCanvas WebGL game engine
74 lines (73 loc) • 2.32 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 desc;
/**
* @type {GPUTextureFormat}
* @private
*/
private format;
/** @type {Texture} */
texture: 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 {WebgpuGraphicsDevice} device - The graphics device.
* @param {Texture} texture - The texture.
*/
uploadImmediate(device: WebgpuGraphicsDevice, texture: Texture): void;
/**
* @param {WebgpuGraphicsDevice} device - The graphics
* device.
*/
uploadData(device: WebgpuGraphicsDevice): void;
isExternalImage(image: any): boolean;
uploadExternalImage(device: any, image: any, mipLevel: any, index: any): void;
uploadTypedArrayData(device: any, data: any, mipLevel: any, index: any): void;
read(x: any, y: any, width: any, height: any, options: any): Promise<any>;
}
import type { Texture } from '../texture.js';
import type { WebgpuGraphicsDevice } from './webgpu-graphics-device.js';