webgpuMaterialContext.d.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { ExternalTexture } from "../../Materials/Textures/externalTexture";
  2. import type { InternalTexture } from "../../Materials/Textures/internalTexture";
  3. import type { TextureSampler } from "../../Materials/Textures/textureSampler";
  4. import type { Nullable } from "../../types";
  5. import type { IMaterialContext } from "../IMaterialContext";
  6. /** @internal */
  7. interface IWebGPUMaterialContextSamplerCache {
  8. sampler: Nullable<TextureSampler>;
  9. hashCode: number;
  10. }
  11. /** @internal */
  12. interface IWebGPUMaterialContextTextureCache {
  13. texture: Nullable<InternalTexture | ExternalTexture>;
  14. isFloatOrDepthTexture: boolean;
  15. isExternalTexture: boolean;
  16. }
  17. /** @internal */
  18. export declare class WebGPUMaterialContext implements IMaterialContext {
  19. private static _Counter;
  20. uniqueId: number;
  21. updateId: number;
  22. isDirty: boolean;
  23. samplers: {
  24. [name: string]: Nullable<IWebGPUMaterialContextSamplerCache>;
  25. };
  26. textures: {
  27. [name: string]: Nullable<IWebGPUMaterialContextTextureCache>;
  28. };
  29. textureState: number;
  30. get forceBindGroupCreation(): boolean;
  31. get hasFloatOrDepthTextures(): boolean;
  32. protected _numFloatOrDepthTextures: number;
  33. protected _numExternalTextures: number;
  34. constructor();
  35. reset(): void;
  36. setSampler(name: string, sampler: Nullable<TextureSampler>): void;
  37. setTexture(name: string, texture: Nullable<InternalTexture | ExternalTexture>): void;
  38. }
  39. export {};