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