/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{FeatureTechnique as e}from"../FeatureTechnique.js";import{getSelectionDefines as s,getFeaturePipelineState as t,isHittest as r,getFeatureUniforms as a,resolveDynamicUniforms as i}from"../featureTechniqueUtils.js";import{TextShader as n}from"../text/TextShader.js";class o extends e{constructor(){super(...arguments),this.type=19,this.shaders={geometry:new n},this.drawPhase=14,this.symbologyPlane=3}render(e,n){const{painter:o}=e,u=s(e),d={...t(e),stencil:{write:!1,test:{compare:516,mask:255,op:{fail:7680,zFail:7680,zPass:7680}}}},m=n.instance.getInput(),c={shader:this.shaders.geometry,uniforms:{...i(e,n.target,m.uniforms),...a(e,n.target),mosaicInfo:o.textureManager.getMosaicInfo(e,n.textureKey)},defines:{...u,textRenderPassType:0,isBackgroundPass:!0,isLabel:!0},optionalAttributes:m.optionalAttributes,useComputeBuffer:r(e)};o.setPipelineState(d),o.setShader(c),o.submitDraw(e,n,{stencilRef:255}),o.setShader({...c,defines:{...u,textRenderPassType:2,isBackgroundPass:!1,isLabel:!0}}),o.submitDraw(e,n,{stencilRef:255}),o.setShader({...c,defines:{...u,textRenderPassType:0,isBackgroundPass:!1,isLabel:!0}}),o.submitDraw(e,n,{stencilRef:255})}}export{o as LabelTechnique};
