/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/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 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 a,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as c}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as p,drawBuffers as u,depthWrite as m,depthTest as f,blending 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 C,cullingParams as T}from"../../../webgl/renderState.js";class v extends b{constructor(){super(...arguments),this.color=t}}let y=class extends a{constructor(e,r){super(e,r,o(x(r))),this.shader=new l(P,()=>import("./ColorMaterial.glsl.js"))}_createPipeline(e,r){const{oitPass:t,output:o,hasEmission:i,transparent:l,cullFace:a,draped:c,hasOccludees:b,polygonOffset:P}=e,v=0===t;return S({blending:s(o)&&l?d(t):null,culling:T(a),depthTest:c?null:f(t),depthWrite:m(e),drawBuffers:n(o,u(t,i)),colorWrite:C,stencilWrite:b?j:null,stencilTest:b?r?h:g:null,polygonOffset:v?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)}};y=e([r("esri.views.3d.webgl-engine.shaders.ColorMaterialTechnique")],y);const w={factor:1,units:1};function x(e){const r=i().vec3f("position");return c()&&r.vec4u8("olidColor"),e.hasVVColor?r.f32("colorFeatureAttribute"):e.hasVertexColors&&r.vec4u8("color",{glNormalized:!0}),r.freeze()}export{v as ColorMaterialPassParameters,y as ColorMaterialTechnique,x as getLayout};
