/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{C as i}from"../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as s}from"../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as t}from"../shaders/CompositingTechniqueConfiguration.js";class o{constructor(s,o){this._rctx=s,this._techniques=o,this._configuration=new t,this._passParameters=new i}precompile(i,t,{hasOpaqueEmission:o,hasTransparentEmission:e}){i&&(this._configuration.blendEmissive=o||e,this._configuration.mode=2,this._techniques.precompile(s,this._configuration)),this._configuration.blendEmissive=o,t&&(this._configuration.mode=1,this._techniques.precompile(s,this._configuration)),this._configuration.mode=3,this._techniques.getCompiled(s,this._configuration)}compositePreMultipliedAlpha(i,s,t=i.hasEmission){this._composite(i,s,2,t)}composite(i,s){this._composite(i,s,1,i.hasEmission)}blitDepthToLinearDepth(i,s){this._composite(i,s,3)}_composite(i,t,o,e=!1){this._configuration.mode=o,this._configuration.blendEmissive=e,this._passParameters.texture=t;const n=this._techniques.get(s,this._configuration);this._rctx.bindTechnique(n,i,this._passParameters),this._rctx.screen.draw()}}export{o as Compositor};
