engineInstrumentation.d.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import { PerfCounter } from "../Misc/perfCounter";
  2. import type { Nullable } from "../types";
  3. import type { IDisposable } from "../scene";
  4. import type { AbstractEngine } from "../Engines/abstractEngine";
  5. /**
  6. * This class can be used to get instrumentation data from a Babylon engine
  7. * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation
  8. */
  9. export declare class EngineInstrumentation implements IDisposable {
  10. /**
  11. * Define the instrumented engine.
  12. */
  13. engine: AbstractEngine;
  14. private _captureGPUFrameTime;
  15. private _captureShaderCompilationTime;
  16. private _shaderCompilationTime;
  17. private _onBeginFrameObserver;
  18. private _onEndFrameObserver;
  19. private _onBeforeShaderCompilationObserver;
  20. private _onAfterShaderCompilationObserver;
  21. /**
  22. * Gets the perf counter used for GPU frame time
  23. */
  24. get gpuFrameTimeCounter(): Nullable<PerfCounter>;
  25. /**
  26. * Gets the GPU frame time capture status
  27. */
  28. get captureGPUFrameTime(): boolean;
  29. /**
  30. * Enable or disable the GPU frame time capture
  31. */
  32. set captureGPUFrameTime(value: boolean);
  33. /**
  34. * Gets the perf counter used for shader compilation time
  35. */
  36. get shaderCompilationTimeCounter(): PerfCounter;
  37. /**
  38. * Gets the shader compilation time capture status
  39. */
  40. get captureShaderCompilationTime(): boolean;
  41. /**
  42. * Enable or disable the shader compilation time capture
  43. */
  44. set captureShaderCompilationTime(value: boolean);
  45. /**
  46. * Instantiates a new engine instrumentation.
  47. * This class can be used to get instrumentation data from a Babylon engine
  48. * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation
  49. * @param engine Defines the engine to instrument
  50. */
  51. constructor(
  52. /**
  53. * Define the instrumented engine.
  54. */
  55. engine: AbstractEngine);
  56. /**
  57. * Dispose and release associated resources.
  58. */
  59. dispose(): void;
  60. }