/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as r}from"../../support/buffer/glUtil.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o,depthOnlyOutputBuffersOr as l}from"../core/shaderTechnique/ShaderTechnique.js";import{oitPolygonOffset as n,drawBuffers as a,depthWrite as p,depthTest as c,blending as u}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as d,stencilBaseAllZerosParams as m,stencilWriteMaskOn as h}from"../lib/StencilUtils.js";import{P as f}from"../../../../chunks/Pattern.glsl.js";import{getLayout as P}from"./PatternLayouts.js";import{makePipelineState as g,defaultColorWrite as j,cullingParams as S}from"../../../webgl/renderState.js";let b=class extends o{constructor(e,t){super(e,t,r(P(t))),this.shader=new s(f,()=>import("./Pattern.glsl.js"))}_setPipelineState(e,t){const{oitPass:r,output:s,hasEmission:o,cullFace:f,draped:P,hasOccludees:b,polygonOffset:w}=e,y=0===r;return g({blending:i(s)?u(r):null,culling:S(f),depthTest:P?null:c(r),depthWrite:p(e),drawBuffers:l(s,a(r,o)),colorWrite:j,stencilWrite:b?h:null,stencilTest:b?t?d:m:null,polygonOffset:y?w?T:null:n(e)})}initializePipeline(e){return this._occludeePipelineState=this._setPipelineState(e,!0),this._setPipelineState(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};b=e([t("esri.views.3d.webgl-engine.shaders.PatternTechnique")],b);const T={factor:1,units:1};export{b as PatternTechnique};
