/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../core/maybe","../../../../core/PerformanceSampler","../../../../core/time","../../../../core/accessorSupport/utils","../../../webgl/Measurement"],(function(e,t,i,r,s,a,n){"use strict";var o;e.Statistics=void 0,(o=e.Statistics||(e.Statistics={}))[o.Prepare=0]="Prepare",o[o.Shadowmap=1]="Shadowmap",o[o.Lineardepth=2]="Lineardepth",o[o.Normals=3]="Normals",o[o.SSAO=4]="SSAO",o[o.Opaque=5]="Opaque",o[o.OpaqueEdges=6]="OpaqueEdges",o[o.Transparent=7]="Transparent",o[o.TransparentEdges=8]="TransparentEdges",o[o.Hudvisibility=9]="Hudvisibility",o[o.TransparentTerrain=10]="TransparentTerrain",o[o.Atmosphere=11]="Atmosphere",o[o.Laserline=12]="Laserline",o[o.Occluded=13]="Occluded",o[o.Antialiasing=14]="Antialiasing",o[o.Highlights=15]="Highlights",o[o.HudOccluded=16]="HudOccluded",o[o.HudNotoccluded=17]="HudNotoccluded";const l=["prepare","shadowmap","lineardepth","normals","ssao","opaque","opaque edges","transparent","transparent edges","hudvisibility","transparent terrain","atmosphere","laserline","occluded","antialiasing","highlights","hudOccluded","hudNotoccluded"];let c=function(e){function i(){var t;return(t=e.call(this,"total")||this).total=0,t.frameCount=0,t}return t._inheritsLoose(i,e),i}(r),u=function(){function e(){this._startTime=s.Milliseconds(0),this._lastSample=s.Milliseconds(0),this._enableGPUTimer=0,this.totalTime=new c,this.gpuTime=new r("gpu",9),this.renderPassTimings=l.map((e=>new r(e)))}var o=e.prototype;return o.enableGPUTimer=function(){return++this._enableGPUTimer,{remove:a.once((()=>--this._enableGPUTimer))}},o.prerender=function(e){this._startTime=this._lastSample=s.Milliseconds(performance.now()),this._enableGPUTimer&&(this._gpuTimer=n.startMeasurement(e))},o.advance=function(e){const t=s.Milliseconds(performance.now());this.renderPassTimings[e].record(t-this._lastSample),this._lastSample=t},o.postrender=function(){i.isSome(this._gpuTimer)&&(this._gpuTimer.stop((e=>i.isSome(e)&&this.gpuTime.record(e)),16),this._gpuTimer=null);const e=performance.now()-this._startTime;this.totalTime.record(e),this.totalTime.total+=e,this.totalTime.frameCount++},t._createClass(e,[{key:"elapsedTime",get:function(){return s.Milliseconds(performance.now()-this._startTime)}}]),e}();e.RenderTime=c,e.RendererPerformanceInfo=u,e.performanceStatsCategories=l,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
