/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{glsl as t}from"../../shaderModules/glsl.js";function a(a,e){switch(e.output){case 5:case 6:case 7:case 8:a.fragment.code.add(t`float _calculateFragDepth(const in float depth) {
const float slope_scale = 2.0;
const float bias = 20.0 * .000015259;
float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
return depth + slope_scale * m + bias;
}
void outputDepth(float _linearDepth){
float fragDepth = _calculateFragDepth(_linearDepth);
gl_FragDepth = fragDepth;
}`);break;case 9:a.fragment.code.add(t`void outputDepth(float _linearDepth){
gl_FragDepth = _linearDepth;
}`)}}export{a as OutputDepth};
