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