/*
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","./interfaces","./OverlayFramebufferObject","../webgl-engine/lib/RenderPass"],(function(e,r,s,t,n){"use strict";let a=function(){function e(e){const r=(r,s,n=!0)=>({type:s,fbo:new t.OverlayFramebufferObject(e,n),renderPass:r,valid:!1,lastUsed:1/0});this.renderTargets=[r(n.RenderPass.MATERIAL,s.RenderTargetType.Color),r(n.RenderPass.MATERIAL,s.RenderTargetType.ColorNoRasterImage),r(n.RenderPass.MATERIAL_HIGHLIGHT,s.RenderTargetType.Highlight,!1),r(n.RenderPass.MATERIAL_NORMAL,s.RenderTargetType.Water),r(n.RenderPass.MATERIAL,s.RenderTargetType.Occluded)]}var a=e.prototype;return a.getTarget=function(e){return this.renderTargets[e].fbo},a.dispose=function(){for(const e of this.renderTargets)e.fbo.dispose()},a.disposeRenderTargetMemory=function(){for(const e of this.renderTargets)e.fbo.disposeRenderTargetMemory()},a.validateUsageForTarget=function(e,r,s){if(e)r.lastUsed=s;else if(s-r.lastUsed>o)r.fbo.disposeRenderTargetMemory(),r.lastUsed=1/0;else if(r.lastUsed<1/0)return!0;return!1},r._createClass(e,[{key:"gpuMemoryUsage",get:function(){return this.renderTargets.reduce(((e,r)=>e+r.fbo.gpuMemoryUsage),0)}}]),e}();const o=1e3;e.OverlayRenderTarget=a,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
