/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["require","exports","../../../../chunks/_rollupPluginBabelHelpers","../core/shaderLibrary/ShaderOutputOptions","../core/shaderTechnique/ReloadableShaderModule","../core/shaderTechnique/ShaderTechnique","../lib/basicInterfaces","../lib/OrderIndependentTransparency","../lib/Program","../lib/RenderSlot","../lib/StencilUtils","../lib/VertexAttribute","../../../../chunks/LineMarker.glsl","../../../webgl/renderState"],(function(e,t,i,r,n,l,a,s,o,u,c,p,d,h){"use strict";const T=new Map([[p.VertexAttribute.POSITION,0],[p.VertexAttribute.UV0,2],[p.VertexAttribute.AUXPOS1,3],[p.VertexAttribute.SIZE,6],[p.VertexAttribute.SIZEFEATUREATTRIBUTE,6],[p.VertexAttribute.COLOR,5],[p.VertexAttribute.COLORFEATUREATTRIBUTE,5],[p.VertexAttribute.OPACITYFEATUREATTRIBUTE,7]]);let P=function(e){function t(){return e.apply(this,arguments)||this}i._inheritsLoose(t,e);var n=t.prototype;return n.initializeProgram=function(e){const i=t.shader.get().build(this.configuration);return new o.Program(e.rctx,i,T)},n._makePipelineState=function(e,t){const i=this.configuration,n=e===a.TransparencyPassType.NONE;return h.makePipelineState({blending:i.output===r.ShaderOutput.Color||i.output===r.ShaderOutput.Alpha?n?s.blendingDefault:s.oitBlending(e):null,depthTest:{func:s.oitDepthTest(e)},depthWrite:n?i.writeDepth&&h.defaultDepthWriteParams:s.oitDepthWrite(e),colorWrite:h.defaultColorWriteParams,stencilWrite:i.hasOccludees?c.stencilWriteMaskOn:null,stencilTest:i.hasOccludees?t?c.stencilToolMaskBaseParams:c.stencilBaseAllZerosParams:null,polygonOffset:{factor:0,units:-10}})},n.initializePipeline=function(){return this.configuration.occluder&&(this._occluderPipelineTransparent=h.makePipelineState({blending:s.blendingDefault,depthTest:c.depthCompareAlways,depthWrite:null,colorWrite:h.defaultColorWriteParams,stencilWrite:null,stencilTest:c.stencilToolTransparentOccluderParams}),this._occluderPipelineOpaque=h.makePipelineState({blending:s.blendingDefault,depthTest:c.depthCompareAlways,depthWrite:null,colorWrite:h.defaultColorWriteParams,stencilWrite:c.stencilWriteMaskOff,stencilTest:c.stencilToolMaskOccluderParams}),this._occluderPipelineMaskWrite=h.makePipelineState({blending:null,depthTest:c.depthCompareLess,depthWrite:null,colorWrite:null,stencilWrite:c.stencilWriteMaskOn,stencilTest:c.stencilToolMaskBaseParams})),this._occludeePipelineState=this._makePipelineState(this.configuration.transparencyPassType,!0),this._makePipelineState(this.configuration.transparencyPassType,!1)},n.getPipelineState=function(t,i){return i?this._occludeePipelineState:this.configuration.occluder?t===u.RenderSlot.TRANSPARENT_OCCLUDER_MATERIAL?this._occluderPipelineTransparent:t===u.RenderSlot.OCCLUDER_MATERIAL?this._occluderPipelineOpaque:this._occluderPipelineMaskWrite:e.prototype.getPipelineState.call(this,t,i)},t}(l.ShaderTechnique);P.shader=new n.ReloadableShaderModule(d.LineMarker,(()=>new Promise(((t,i)=>e(["./LineMarker.glsl"],t,i))))),t.LineMarkerTechnique=P,t.markerVertexAttributeLocations=T,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
