// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define(["exports","../../core/has","./checkWebGLError","./enums","./ShaderTranspiler"],function(m,x,n,g,r){function t(a,b,c){a=a.gl;const d=a.createShader(b);a.shaderSource(d,c);a.compileShader(d);n.webglValidateShadersEnabled()&&!a.getShaderParameter(d,a.COMPILE_STATUS)&&(console.error("Compile error in ".concat(b===g.ShaderType.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(a.getShaderInfoLog(d)),console.error(v(c)));return d}function v(a){let b=2;return a.replaceAll("\n",()=>{var c= b++;c=1E3<=c?c.toString():(" "+c).slice(-3);return"\n"+c+":"})}function l(a,b,c){const d=a.get(b);if(!d)return a.set(b,Array.from(c)),!0;const e=c.length;if(d.length!==e)return a.set(b,Array.from(c)),!0;for(a=0;af.bindAttribLocation(k,p,q));this._transformFeedbackVaryings?.length&&f.transformFeedbackVaryings(k,this._transformFeedbackVaryings,f.SEPARATE_ATTRIBS);f.linkProgram(k);n.webglValidateShadersEnabled()&&!f.getProgramParameter(k,f.LINK_STATUS)&&console.error("Could not link shader\n"+`validated: ${f.getProgramParameter(k,f.VALIDATE_STATUS)}`+`, gl error ${f.getError()}`+`, vertex: ${f.getShaderParameter(this._vShader, f.COMPILE_STATUS)}`+`, fragment: ${f.getShaderParameter(this._fShader,f.COMPILE_STATUS)}`+`, info log: ${f.getProgramInfoLog(k)}`+`, vertex source: ${this.vertexShader}`+`, fragment source: ${this.fragmentShader}`);for(const [p,q]of this._uniformBlockBindings)a=f.getUniformBlockIndex(k,p),4294967295>a&&f.uniformBlockBinding(k,a,q);this._glName=k;this._context.instanceCounter.increment(g.ResourceType.Program,this)}get glName(){return this._glName}get hasGLName(){return null!=this._glName}get hasTransformFeedbackVaryings(){return!!this._transformFeedbackVaryings?.length}get compiled(){if(this._compiled)return!0; const a=this._context.gl.getExtension("KHR_parallel_shader_compile");return null==a||null==this.glName?this._compiled=!0:this._compiled=!!this._context.gl.getProgramParameter(this.glName,a.COMPLETION_STATUS_KHR)}dispose(){if(!(0<--this._refCount)){var a=this._context.gl,b=this._context.instanceCounter;this._nameToUniformLocation.forEach(c=>c&&b.decrement(g.ResourceType.Uniform,c));this._nameToUniformLocation.clear();this._vShader&&(0