/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{C as i}from"../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as t}from"../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as s}from"../shaders/CompositingTechniqueConfiguration.js";import{H as e}from"../../../../chunks/HUDCompositing.glsl.js";import{HUDCompositingTechnique as o}from"../shaders/HUDCompositingTechnique.js";class n{constructor(n,h){this._rctx=n,this._techniques=h,this._configuration=new s,this._passParameters=new i,this._hudParameters=new e,this._configuration.blitMode=2,this._techniques.precompile(t,this._configuration),this._configuration.blendEmissive=!0,this._techniques.precompile(t,this._configuration),this._configuration.blitMode=1,this._techniques.precompile(t,this._configuration),this._configuration.blendEmissive=!1,this._techniques.precompile(t,this._configuration),this._configuration.blitMode=3,this._techniques.precompile(t,this._configuration),this._techniques.precompile(o)}compositeHUD(i,t){this._hudParameters.texture=t;const s=this._techniques.get(o);this._rctx.bindTechnique(s,i,this._hudParameters),this._rctx.screen.draw()}compositePreMultipliedAlpha(i,t,s=i.hasEmission){this._composite(i,t,2,s)}composite(i,t){this._composite(i,t,1,i.hasEmission)}blitDepthToLinearDepth(i,t){this._composite(i,t,3)}_composite(i,s,e,o=!1){this._configuration.blitMode=e,this._configuration.blendEmissive=o,this._passParameters.texture=s;const n=this._techniques.get(t,this._configuration);this._rctx.bindTechnique(n,i,this._passParameters),this._rctx.screen.draw()}}export{n as default};
