/*
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 r}from"../../support/buffer/glUtil.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{isColor as o}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as c}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as p,depthWrite as a,depthTest as u,blending as d,drawBuffers as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as m,stencilBaseAllZerosParams as h,stencilWriteMaskOn as g}from"../lib/StencilUtils.js";import{P}from"../../../../chunks/Pattern.glsl.js";import{makePipelineState as b,defaultColorWrite as j,cullingParams as S}from"../../../webgl/renderState.js";let v=class extends l{constructor(e,t){super(e,t,r(y(t))),this.shader=new s(P,()=>import("./Pattern.glsl.js"))}_setPipelineState(e,t){const{oitPass:r,output:i,hasEmission:s,cullFace:l,draped:c,hasOccludees:P,polygonOffset:v}=e,y=0===r;return b({blending:o(i)?d(r):null,culling:S(l),depthTest:c?null:u(r),depthWrite:a(e),drawBuffers:n(i,f(r,s)),colorWrite:j,stencilWrite:P?g:null,stencilTest:P?t?m:h:null,polygonOffset:y?v?T:null:p(e)})}initializePipeline(e){return this._occludeePipelineState=this._setPipelineState(e,!0),this._setPipelineState(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};v=e([t("esri.views.3d.webgl-engine.shaders.PatternTechnique")],v);const T={factor:1,units:1};function y(e){const t=i().vec3f("position").vec4f("uvMapSpace");return e.draped||t.mat3f("boundingRect"),e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color"),c()&&t.vec4u8("olidColor"),t.freeze()}export{v as PatternTechnique,y as getLayout};
