4d4c028dc350817b4a1a6a3eb132e3635db83bd3736bf8d25167c1e929571d4e.json 2.7 KB

1
  1. {"ast":null,"code":"import { PerfCounter } from \"../../Misc/perfCounter.js\";\n/**\n * Class used to define a WebGPU performance counter\n */\nexport class WebGPUPerfCounter {\n constructor() {\n this._gpuTimeInFrameId = -1;\n /**\n * The GPU time in nanoseconds spent in the last frame\n */\n this.counter = new PerfCounter();\n }\n /**\n * @internal\n */\n _addDuration(currentFrameId, duration) {\n if (currentFrameId < this._gpuTimeInFrameId) {\n return;\n }\n if (this._gpuTimeInFrameId !== currentFrameId) {\n this.counter._fetchResult();\n this.counter.fetchNewFrame();\n this.counter.addCount(duration, false);\n this._gpuTimeInFrameId = currentFrameId;\n } else {\n this.counter.addCount(duration, false);\n }\n }\n}","map":{"version":3,"names":["PerfCounter","WebGPUPerfCounter","constructor","_gpuTimeInFrameId","counter","_addDuration","currentFrameId","duration","_fetchResult","fetchNewFrame","addCount"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Engines/WebGPU/webgpuPerfCounter.js"],"sourcesContent":["import { PerfCounter } from \"../../Misc/perfCounter.js\";\n/**\n * Class used to define a WebGPU performance counter\n */\nexport class WebGPUPerfCounter {\n constructor() {\n this._gpuTimeInFrameId = -1;\n /**\n * The GPU time in nanoseconds spent in the last frame\n */\n this.counter = new PerfCounter();\n }\n /**\n * @internal\n */\n _addDuration(currentFrameId, duration) {\n if (currentFrameId < this._gpuTimeInFrameId) {\n return;\n }\n if (this._gpuTimeInFrameId !== currentFrameId) {\n this.counter._fetchResult();\n this.counter.fetchNewFrame();\n this.counter.addCount(duration, false);\n this._gpuTimeInFrameId = currentFrameId;\n }\n else {\n this.counter.addCount(duration, false);\n }\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,2BAA2B;AACvD;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,CAAC;EAC3BC,WAAWA,CAAA,EAAG;IACV,IAAI,CAACC,iBAAiB,GAAG,CAAC,CAAC;IAC3B;AACR;AACA;IACQ,IAAI,CAACC,OAAO,GAAG,IAAIJ,WAAW,CAAC,CAAC;EACpC;EACA;AACJ;AACA;EACIK,YAAYA,CAACC,cAAc,EAAEC,QAAQ,EAAE;IACnC,IAAID,cAAc,GAAG,IAAI,CAACH,iBAAiB,EAAE;MACzC;IACJ;IACA,IAAI,IAAI,CAACA,iBAAiB,KAAKG,cAAc,EAAE;MAC3C,IAAI,CAACF,OAAO,CAACI,YAAY,CAAC,CAAC;MAC3B,IAAI,CAACJ,OAAO,CAACK,aAAa,CAAC,CAAC;MAC5B,IAAI,CAACL,OAAO,CAACM,QAAQ,CAACH,QAAQ,EAAE,KAAK,CAAC;MACtC,IAAI,CAACJ,iBAAiB,GAAGG,cAAc;IAC3C,CAAC,MACI;MACD,IAAI,CAACF,OAAO,CAACM,QAAQ,CAACH,QAAQ,EAAE,KAAK,CAAC;IAC1C;EACJ;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}