/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{glLayout as t}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 l}from"../core/shaderTechnique/ShaderTechnique.js";import{oitPolygonOffset as o,drawBuffers as n,depthWrite as a,depthTest as p,blending as c}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as m,stencilWriteMaskOn as d}from"../lib/StencilUtils.js";import{PositionUvLayout as h}from"../materials/DefaultLayouts.js";import{I as f}from"../../../../chunks/ImageMaterial.glsl.js";import{makePipelineState as g,defaultColorWrite as j,cullingParams as b}from"../../../webgl/renderState.js";let P=class extends l{constructor(e,r){super(e,r,t(S(r))),this.shader=new s(f,()=>import("./ImageMaterial.glsl.js"))}_getPipelineState(e,r){const{oitPass:t,output:s,hasEmission:l,hasOccludees:h,cullFace:f}=e;return g({blending:i(s)?c(t,!0):null,culling:b(f),depthTest:p(t),depthWrite:a(e),drawBuffers:n(t,l),colorWrite:j,stencilWrite:h?d:null,stencilTest:h?r?u:m:null,polygonOffset:o(e)})}initializePipeline(e){return this._occludeePipeline=this._getPipelineState(e,!0),this._getPipelineState(e,!1)}getPipeline(e,r){return r?this._occludeePipeline:super.getPipeline(e)}};function S(e){let r=h;return e.perspectiveInterpolation&&(r=r.clone().f32("perspectiveDivide")),r}P=e([r("esri.views.3d.webgl-engine.shaders.ImageMaterialTechnique")],P);export{P as ImageMaterialTechnique,S as getLayout};
