/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as i}from"../../support/buffer/glUtil.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as n,depthOnlyOutputBuffersOr as o}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as c,depthTest as p,blending as u,drawBuffers as a}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as d,stencilBaseAllZerosParams as h,stencilWriteMaskOn as f,stencilToolTransparentOccluderParams as m,depthCompareAlways as P,stencilToolMaskOccluderParams as b,stencilWriteMaskOff as g,depthCompareLess as T}from"../lib/StencilUtils.js";import{L as W}from"../../../../chunks/LineMarker.glsl.js";import{makePipelineState as _,defaultColorWrite as S,unpremultipliedAlphaToPremultipliedAlpha as j}from"../../../webgl/renderState.js";let k=class extends n{constructor(e,t){super(e,t,i(v(t))),this.shader=new s(W,()=>import("./LineMarker.glsl.js"))}_makePipelineState(e,t){const{output:i,hasEmission:r,oitPass:s,space:n,hasOccludees:m}=e;return _({blending:l(i)?u(s):null,depthTest:0===n?null:p(s),depthWrite:c(e),drawBuffers:o(i,a(s,r)),colorWrite:S,stencilWrite:m?f:null,stencilTest:m?t?d:h:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=_({blending:j,depthTest:P,depthWrite:null,colorWrite:S,stencilWrite:null,stencilTest:m}),this._occluderPipelineOpaque=_({blending:j,depthTest:P,depthWrite:null,colorWrite:S,stencilWrite:g,stencilTest:b}),this._occluderPipelineMaskWrite=_({blending:null,depthTest:T,depthWrite:null,colorWrite:null,stencilWrite:f,stencilTest:d})):this._occluderPipelineTransparent=this._occluderPipelineOpaque=this._occluderPipelineMaskWrite=null,this._occludeePipelineState=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:12===e.occluder?this._occluderPipelineTransparent??super.getPipeline(e):11===e.occluder?this._occluderPipelineOpaque??super.getPipeline(e):this._occluderPipelineMaskWrite??super.getPipeline(e)}};function v(e){const t=r().vec3f("position").vec4f16("previousDelta").vec2f16("uv0");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f16("size"),e.worldSpace&&t.vec3f16("normal"),t.freeze()}k=e([t("esri.views.3d.webgl-engine.shaders.LineMarkerTechnique")],k);export{k as LineMarkerTechnique,v as getLayout};
