/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
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 i}from"../../support/buffer/glUtil.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{depthWrite as a,depthTest as c,blending as p}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as m,stencilBaseAllZeros as u,stencilWriteMaskOn as f}from"../lib/StencilUtils.js";import{polygonOffset as d}from"../materials/PolygonOffset.js";import{VisualVariablePassParameters as h}from"../materials/VisualVariablePassParameters.js";import{C as g}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as j,defaultColorWrite as b,cullingParams as P}from"../../../webgl/renderState.js";class C extends h{constructor(){super(...arguments),this.color=t}}let S=class extends l{constructor(e,r){super(e,r,i(T(r))),this.shader=new s(g,()=>import("./ColorMaterial.glsl.js")),this.ignoreUnused=!0}_createPipeline(e,r){const{output:t,transparent:i,cullFace:o,draped:s,hasOccludees:l}=e;return j({blending:i?p(t,!1,e.emissionDimmingPass):null,culling:P(o),depthTest:s?null:c(t),depthWrite:a(e),colorWrite:b,stencilWrite:l?f:null,stencilTest:l?r?m:u:null,polygonOffset:d(e)})}initializePipeline(e){return this._occludeePipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}getPipeline(e,r,t){return t?this._occludeePipelineState:super.getPipeline(e,r)}};function T(e){const r=o().vec3f("position");return n()&&r.vec4u8("olidColor"),e.hasVVColor?r.f32("colorFeatureAttribute"):e.hasVertexColors&&r.vec4u8("color",{glNormalized:!0}),r.freeze()}S=e([r("esri.views.3d.webgl-engine.shaders.ColorMaterialTechnique")],S);export{C as ColorMaterialPassParameters,S as ColorMaterialTechnique,T as getLayout};
