/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{FloatDrawUniform as a}from"../../shaderModules/FloatDrawUniform.js";import{FloatPassUniform as o}from"../../shaderModules/FloatPassUniform.js";import{alphaCutoff as d}from"../../../shaders/alphaCutoff.glsl.js";function e(a,d){t(a,d,new o("textureAlphaCutoff",a=>a.textureAlphaCutoff))}function r(o,d){t(o,d,new a("textureAlphaCutoff",a=>a.textureAlphaCutoff))}function t(a,o,e){const r=a.fragment;switch(r.code.add("void discardOrAdjustAlpha(inout vec4 color) {"),o.alphaDiscardMode){case 1:r.code.add("color.a = 1.0;");break;case 0:r.include(d),r.code.add("if (color.a < alphaCutoff) discard;");break;case 3:r.uniforms.add(e).code.add("if (color.a < textureAlphaCutoff) discard;");break;case 2:r.uniforms.add(e).code.add("\n        if (color.a < textureAlphaCutoff) discard;\n        color.a = 1.0;\n      ");break;case 4:break;default:o.alphaDiscardMode}r.code.add("}")}export{r as DiscardOrAdjustAlphaDraw,e as DiscardOrAdjustAlphaPass};
