webgpuTextureHelper.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829
  1. import type { InternalTexture } from "../../Materials/Textures/internalTexture";
  2. import type { HardwareTextureWrapper } from "../../Materials/Textures/hardwareTextureWrapper";
  3. /** @internal */
  4. export declare class WebGPUTextureHelper {
  5. static ComputeNumMipmapLevels(width: number, height: number): number;
  6. static GetTextureTypeFromFormat(format: GPUTextureFormat): number;
  7. static GetBlockInformationFromFormat(format: GPUTextureFormat): {
  8. width: number;
  9. height: number;
  10. length: number;
  11. };
  12. static IsHardwareTexture(texture: HardwareTextureWrapper | GPUTexture): texture is HardwareTextureWrapper;
  13. static IsInternalTexture(texture: InternalTexture | GPUTexture): texture is InternalTexture;
  14. static IsImageBitmap(imageBitmap: ImageBitmap | {
  15. width: number;
  16. height: number;
  17. }): imageBitmap is ImageBitmap;
  18. static IsImageBitmapArray(imageBitmap: ImageBitmap[] | {
  19. width: number;
  20. height: number;
  21. }): imageBitmap is ImageBitmap[];
  22. static IsCompressedFormat(format: GPUTextureFormat): boolean;
  23. static GetWebGPUTextureFormat(type: number, format: number, useSRGBBuffer?: boolean): GPUTextureFormat;
  24. static GetNumChannelsFromWebGPUTextureFormat(format: GPUTextureFormat): number;
  25. static HasStencilAspect(format: GPUTextureFormat): boolean;
  26. static HasDepthAndStencilAspects(format: GPUTextureFormat): boolean;
  27. static GetDepthFormatOnly(format: GPUTextureFormat): GPUTextureFormat;
  28. static GetSample(sampleCount: number): 1 | 4;
  29. }