/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../core/maybe","../core/shaderLibrary/ShaderOutputOptions","./basicInterfaces","./RenderPass"],(function(e,t,r,s,a){"use strict";let u=function(){function e(e,t){this._material=e,this._repository=t,this._map=new Map}var r=e.prototype;return r.destroy=function(){this._map.forEach(((e,r)=>{t.isSome(e)&&this._repository.release(this._material,i(r))}))},r.load=function(e,r){this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,i(r)));const a=this._map.get(r);if(t.isSome(a)){if(a.ensureResources(e)===s.ResourceState.LOADED)return a;this._repository.requestRender()}return null},e}();function i(e){switch(e){case a.RenderPass.MATERIAL:return r.ShaderOutput.Color;case a.RenderPass.MATERIAL_ALPHA:return r.ShaderOutput.Alpha;case a.RenderPass.MATERIAL_DEPTH:return r.ShaderOutput.Depth;case a.RenderPass.MATERIAL_NORMAL:return r.ShaderOutput.Normal;case a.RenderPass.MATERIAL_DEPTH_SHADOWMAP_ALL:return r.ShaderOutput.Shadow;case a.RenderPass.MATERIAL_HIGHLIGHT:return r.ShaderOutput.Highlight;case a.RenderPass.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT:case a.RenderPass.MATERIAL_DEPTH_SHADOWMAP_DEFAULT:return r.ShaderOutput.Shadow}}e.GLMaterials=u,e.outputFromPass=i,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
