123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486 |
- import {
- c as c2
- } from "./chunk-QXZVBSBH.js";
- import {
- H,
- t as t2
- } from "./chunk-MI7HWWFL.js";
- import {
- o
- } from "./chunk-LGW7TID4.js";
- import {
- c2 as c,
- r,
- t
- } from "./chunk-GZT4BVFP.js";
- // node_modules/@arcgis/core/views/webgl/reservedWordsGLSL3.js
- var e = ["layout", "centroid", "smooth", "case", "mat2x2", "mat2x3", "mat2x4", "mat3x2", "mat3x3", "mat3x4", "mat4x2", "mat4x3", "mat4x4", "uint", "uvec2", "uvec3", "uvec4", "samplerCubeShadow", "sampler2DArray", "sampler2DArrayShadow", "isampler2D", "isampler3D", "isamplerCube", "isampler2DArray", "usampler2D", "usampler3D", "usamplerCube", "usampler2DArray", "coherent", "restrict", "readonly", "writeonly", "resource", "atomic_uint", "noperspective", "patch", "sample", "subroutine", "common", "partition", "active", "filter", "image1D", "image2D", "image3D", "imageCube", "iimage1D", "iimage2D", "iimage3D", "iimageCube", "uimage1D", "uimage2D", "uimage3D", "uimageCube", "image1DArray", "image2DArray", "iimage1DArray", "iimage2DArray", "uimage1DArray", "uimage2DArray", "image1DShadow", "image2DShadow", "image1DArrayShadow", "image2DArrayShadow", "imageBuffer", "iimageBuffer", "uimageBuffer", "sampler1DArray", "sampler1DArrayShadow", "isampler1D", "isampler1DArray", "usampler1D", "usampler1DArray", "isampler2DRect", "usampler2DRect", "samplerBuffer", "isamplerBuffer", "usamplerBuffer", "sampler2DMS", "isampler2DMS", "usampler2DMS", "sampler2DMSArray", "isampler2DMSArray", "usampler2DMSArray", "trunc", "round", "roundEven", "isnan", "isinf", "floatBitsToInt", "floatBitsToUint", "intBitsToFloat", "uintBitsToFloat", "packSnorm2x16", "unpackSnorm2x16", "packUnorm2x16", "unpackUnorm2x16", "packHalf2x16", "unpackHalf2x16", "outerProduct", "transpose", "determinant", "inverse", "texture", "textureSize", "textureProj", "textureLod", "textureOffset", "texelFetch", "texelFetchOffset", "textureProjOffset", "textureLodOffset", "textureProjLod", "textureProjLodOffset", "textureGrad", "textureGradOffset", "textureProjGrad", "textureProjGradOffset"];
- // node_modules/@arcgis/core/views/webgl/testUtils.js
- var e2 = { enableCache: false };
- // node_modules/@arcgis/core/views/webgl/ShaderTranspiler.js
- var o2;
- var n = { exports: {} };
- (o2 = ["precision", "highp", "mediump", "lowp", "attribute", "const", "uniform", "varying", "break", "continue", "do", "for", "while", "if", "else", "in", "out", "inout", "float", "int", "void", "bool", "true", "false", "discard", "return", "mat2", "mat3", "mat4", "vec2", "vec3", "vec4", "ivec2", "ivec3", "ivec4", "bvec2", "bvec3", "bvec4", "sampler1D", "sampler2D", "sampler3D", "samplerCube", "sampler1DShadow", "sampler2DShadow", "struct", "asm", "class", "union", "enum", "typedef", "template", "this", "packed", "goto", "switch", "default", "inline", "noinline", "volatile", "public", "static", "extern", "external", "interface", "long", "short", "double", "half", "fixed", "unsigned", "input", "output", "hvec2", "hvec3", "hvec4", "dvec2", "dvec3", "dvec4", "fvec2", "fvec3", "fvec4", "sampler2DRect", "sampler3DRect", "sampler2DRectShadow", "sizeof", "cast", "namespace", "using"]) !== void 0 && (n.exports = o2);
- var i = n.exports;
- var l;
- var s = { exports: {} };
- l = s, function(e5) {
- var t3 = ["<<=", ">>=", "++", "--", "<<", ">>", "<=", ">=", "==", "!=", "&&", "||", "+=", "-=", "*=", "/=", "%=", "&=", "^^", "^=", "|=", "(", ")", "[", "]", ".", "!", "~", "*", "/", "%", "+", "-", "<", ">", "&", "^", "|", "?", ":", "=", ",", ";", "{", "}"];
- t3 !== void 0 && (l.exports = t3);
- }();
- var c3 = s.exports;
- var d = { exports: {} };
- !function(e5) {
- !function(t3) {
- var r2 = function() {
- return ["abs", "acos", "all", "any", "asin", "atan", "ceil", "clamp", "cos", "cross", "dFdx", "dFdy", "degrees", "distance", "dot", "equal", "exp", "exp2", "faceforward", "floor", "fract", "gl_BackColor", "gl_BackLightModelProduct", "gl_BackLightProduct", "gl_BackMaterial", "gl_BackSecondaryColor", "gl_ClipPlane", "gl_ClipVertex", "gl_Color", "gl_DepthRange", "gl_DepthRangeParameters", "gl_EyePlaneQ", "gl_EyePlaneR", "gl_EyePlaneS", "gl_EyePlaneT", "gl_Fog", "gl_FogCoord", "gl_FogFragCoord", "gl_FogParameters", "gl_FragColor", "gl_FragCoord", "gl_FragData", "gl_FragDepth", "gl_FragDepthEXT", "gl_FrontColor", "gl_FrontFacing", "gl_FrontLightModelProduct", "gl_FrontLightProduct", "gl_FrontMaterial", "gl_FrontSecondaryColor", "gl_LightModel", "gl_LightModelParameters", "gl_LightModelProducts", "gl_LightProducts", "gl_LightSource", "gl_LightSourceParameters", "gl_MaterialParameters", "gl_MaxClipPlanes", "gl_MaxCombinedTextureImageUnits", "gl_MaxDrawBuffers", "gl_MaxFragmentUniformComponents", "gl_MaxLights", "gl_MaxTextureCoords", "gl_MaxTextureImageUnits", "gl_MaxTextureUnits", "gl_MaxVaryingFloats", "gl_MaxVertexAttribs", "gl_MaxVertexTextureImageUnits", "gl_MaxVertexUniformComponents", "gl_ModelViewMatrix", "gl_ModelViewMatrixInverse", "gl_ModelViewMatrixInverseTranspose", "gl_ModelViewMatrixTranspose", "gl_ModelViewProjectionMatrix", "gl_ModelViewProjectionMatrixInverse", "gl_ModelViewProjectionMatrixInverseTranspose", "gl_ModelViewProjectionMatrixTranspose", "gl_MultiTexCoord0", "gl_MultiTexCoord1", "gl_MultiTexCoord2", "gl_MultiTexCoord3", "gl_MultiTexCoord4", "gl_MultiTexCoord5", "gl_MultiTexCoord6", "gl_MultiTexCoord7", "gl_Normal", "gl_NormalMatrix", "gl_NormalScale", "gl_ObjectPlaneQ", "gl_ObjectPlaneR", "gl_ObjectPlaneS", "gl_ObjectPlaneT", "gl_Point", "gl_PointCoord", "gl_PointParameters", "gl_PointSize", "gl_Position", "gl_ProjectionMatrix", "gl_ProjectionMatrixInverse", "gl_ProjectionMatrixInverseTranspose", "gl_ProjectionMatrixTranspose", "gl_SecondaryColor", "gl_TexCoord", "gl_TextureEnvColor", "gl_TextureMatrix", "gl_TextureMatrixInverse", "gl_TextureMatrixInverseTranspose", "gl_TextureMatrixTranspose", "gl_Vertex", "greaterThan", "greaterThanEqual", "inversesqrt", "length", "lessThan", "lessThanEqual", "log", "log2", "matrixCompMult", "max", "min", "mix", "mod", "normalize", "not", "notEqual", "pow", "radians", "reflect", "refract", "sign", "sin", "smoothstep", "sqrt", "step", "tan", "texture2D", "texture2DLod", "texture2DProj", "texture2DProjLod", "textureCube", "textureCubeLod", "texture2DLodEXT", "texture2DProjLodEXT", "textureCubeLodEXT", "texture2DGradEXT", "texture2DProjGradEXT", "textureCubeGradEXT"];
- }();
- r2 !== void 0 && (e5.exports = r2);
- }();
- }(d);
- var u = d.exports;
- var g = 999;
- var p = 9999;
- var f = 0;
- var _ = 1;
- var h = 2;
- var x = 3;
- var m = 4;
- var y = 5;
- var w = 6;
- var M = 7;
- var v = 8;
- var T = 9;
- var b = 10;
- var P = 11;
- var E = ["block-comment", "line-comment", "preprocessor", "operator", "integer", "float", "ident", "builtin", "keyword", "whitespace", "eof", "integer"];
- function C() {
- var e5, t3, r2, a2 = 0, o3 = 0, n2 = g, l3 = [], s2 = [], d2 = 1, C2 = 0, k2 = 0, j2 = false, D2 = false, F2 = "";
- return function(e6) {
- return s2 = [], e6 !== null ? S2(e6.replace ? e6.replace(/\r\n/g, "\n") : e6) : R2();
- };
- function L2(e6) {
- e6.length && s2.push({ type: E[n2], data: e6, position: k2, line: d2, column: C2 });
- }
- function S2(t4) {
- var i2;
- for (a2 = 0, r2 = (F2 += t4).length; e5 = F2[a2], a2 < r2; ) {
- switch (i2 = a2, n2) {
- case f:
- a2 = I2();
- break;
- case _:
- a2 = G2();
- break;
- case h:
- a2 = A2();
- break;
- case x:
- a2 = O2();
- break;
- case m:
- a2 = B();
- break;
- case P:
- a2 = q2();
- break;
- case y:
- a2 = H2();
- break;
- case p:
- a2 = N();
- break;
- case T:
- a2 = X2();
- break;
- case g:
- a2 = V2();
- }
- if (i2 !== a2)
- if (F2[i2] === "\n")
- C2 = 0, ++d2;
- else
- ++C2;
- }
- return o3 += a2, F2 = F2.slice(a2), s2;
- }
- function R2(e6) {
- return l3.length && L2(l3.join("")), n2 = b, L2("(eof)"), s2;
- }
- function V2() {
- return l3 = l3.length ? [] : l3, t3 === "/" && e5 === "*" ? (k2 = o3 + a2 - 1, n2 = f, t3 = e5, a2 + 1) : t3 === "/" && e5 === "/" ? (k2 = o3 + a2 - 1, n2 = _, t3 = e5, a2 + 1) : e5 === "#" ? (n2 = h, k2 = o3 + a2, a2) : /\s/.test(e5) ? (n2 = T, k2 = o3 + a2, a2) : (j2 = /\d/.test(e5), D2 = /[^\w_]/.test(e5), k2 = o3 + a2, n2 = j2 ? m : D2 ? x : p, a2);
- }
- function X2() {
- return /[^\s]/g.test(e5) ? (L2(l3.join("")), n2 = g, a2) : (l3.push(e5), t3 = e5, a2 + 1);
- }
- function A2() {
- return e5 !== "\r" && e5 !== "\n" || t3 === "\\" ? (l3.push(e5), t3 = e5, a2 + 1) : (L2(l3.join("")), n2 = g, a2);
- }
- function G2() {
- return A2();
- }
- function I2() {
- return e5 === "/" && t3 === "*" ? (l3.push(e5), L2(l3.join("")), n2 = g, a2 + 1) : (l3.push(e5), t3 = e5, a2 + 1);
- }
- function O2() {
- if (t3 === "." && /\d/.test(e5))
- return n2 = y, a2;
- if (t3 === "/" && e5 === "*")
- return n2 = f, a2;
- if (t3 === "/" && e5 === "/")
- return n2 = _, a2;
- if (e5 === "." && l3.length) {
- for (; U2(l3); )
- ;
- return n2 = y, a2;
- }
- if (e5 === ";" || e5 === ")" || e5 === "(") {
- if (l3.length)
- for (; U2(l3); )
- ;
- return L2(e5), n2 = g, a2 + 1;
- }
- var r3 = l3.length === 2 && e5 !== "=";
- if (/[\w_\d\s]/.test(e5) || r3) {
- for (; U2(l3); )
- ;
- return n2 = g, a2;
- }
- return l3.push(e5), t3 = e5, a2 + 1;
- }
- function U2(e6) {
- for (var t4, r3, a3 = 0; ; ) {
- if (t4 = c3.indexOf(e6.slice(0, e6.length + a3).join("")), r3 = c3[t4], t4 === -1) {
- if (a3-- + e6.length > 0)
- continue;
- r3 = e6.slice(0, 1).join("");
- }
- return L2(r3), k2 += r3.length, (l3 = l3.slice(r3.length)).length;
- }
- }
- function q2() {
- return /[^a-fA-F0-9]/.test(e5) ? (L2(l3.join("")), n2 = g, a2) : (l3.push(e5), t3 = e5, a2 + 1);
- }
- function B() {
- return e5 === "." || /[eE]/.test(e5) ? (l3.push(e5), n2 = y, t3 = e5, a2 + 1) : e5 === "x" && l3.length === 1 && l3[0] === "0" ? (n2 = P, l3.push(e5), t3 = e5, a2 + 1) : /[^\d]/.test(e5) ? (L2(l3.join("")), n2 = g, a2) : (l3.push(e5), t3 = e5, a2 + 1);
- }
- function H2() {
- return e5 === "f" && (l3.push(e5), t3 = e5, a2 += 1), /[eE]/.test(e5) || e5 === "-" && /[eE]/.test(t3) ? (l3.push(e5), t3 = e5, a2 + 1) : /[^\d]/.test(e5) ? (L2(l3.join("")), n2 = g, a2) : (l3.push(e5), t3 = e5, a2 + 1);
- }
- function N() {
- if (/[^\d\w_]/.test(e5)) {
- var r3 = l3.join("");
- return n2 = i.indexOf(r3) > -1 ? v : u.indexOf(r3) > -1 ? M : w, L2(l3.join("")), n2 = g, a2;
- }
- return l3.push(e5), t3 = e5, a2 + 1;
- }
- }
- function k(e5) {
- var t3 = C(), r2 = [];
- return r2 = (r2 = r2.concat(t3(e5))).concat(t3(null));
- }
- function j(e5) {
- return k(e5);
- }
- function D(e5) {
- return e5.map((e6) => e6.type !== "eof" ? e6.data : "").join("");
- }
- var F = ["GL_OES_standard_derivatives", "GL_EXT_frag_depth", "GL_EXT_draw_buffers", "GL_EXT_shader_texture_lod"];
- function L(e5, t3 = "100", r2 = "300 es") {
- const a2 = /^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;
- for (const o3 of e5)
- if (o3.type === "preprocessor") {
- const e6 = a2.exec(o3.data);
- if (e6) {
- const a3 = e6[1].replace(/\s\s+/g, " ");
- if (a3 === r2)
- return a3;
- if (a3 === t3)
- return o3.data = "#version " + r2, t3;
- throw new Error("unknown glsl version: " + a3);
- }
- }
- return e5.splice(0, 0, { type: "preprocessor", data: "#version " + r2 }, { type: "whitespace", data: "\n" }), null;
- }
- function S(e5, t3) {
- for (let r2 = t3 - 1; r2 >= 0; r2--) {
- const t4 = e5[r2];
- if (t4.type !== "whitespace" && t4.type !== "block-comment") {
- if (t4.type !== "keyword")
- break;
- if (t4.data === "attribute" || t4.data === "in")
- return true;
- }
- }
- return false;
- }
- function R(e5, t3, r2, a2) {
- a2 = a2 || r2;
- for (const o3 of e5)
- if (o3.type === "ident" && o3.data === r2) {
- a2 in t3 ? t3[a2]++ : t3[a2] = 0;
- return R(e5, t3, a2 + "_" + t3[a2], a2);
- }
- return r2;
- }
- function V(e5, t3, r2 = "afterVersion") {
- function a2(e6, t4) {
- for (let r3 = t4; r3 < e6.length; r3++) {
- const t5 = e6[r3];
- if (t5.type === "operator" && t5.data === ";")
- return r3;
- }
- return null;
- }
- function o3(e6) {
- let t4 = -1, o4 = 0, n3 = -1;
- for (let i3 = 0; i3 < e6.length; i3++) {
- const l4 = e6[i3];
- if (l4.type === "preprocessor" && (l4.data.match(/\#(if|ifdef|ifndef)\s+.+/) ? ++o4 : l4.data.match(/\#endif\s*.*/) && --o4), r2 !== "afterVersion" && r2 !== "afterPrecision" || l4.type === "preprocessor" && /^#version/.test(l4.data) && (n3 = Math.max(n3, i3)), r2 === "afterPrecision" && l4.type === "keyword" && l4.data === "precision") {
- const t5 = a2(e6, i3);
- if (t5 === null)
- throw new Error("precision statement not followed by any semicolons!");
- n3 = Math.max(n3, t5);
- }
- t4 < n3 && o4 === 0 && (t4 = i3);
- }
- return t4 + 1;
- }
- const n2 = { data: "\n", type: "whitespace" }, i2 = (t4) => t4 < e5.length && /[^\r\n]$/.test(e5[t4].data);
- let l3 = o3(e5);
- i2(l3 - 1) && e5.splice(l3++, 0, n2);
- for (const s2 of t3)
- e5.splice(l3++, 0, s2);
- i2(l3 - 1) && i2(l3) && e5.splice(l3, 0, n2);
- }
- function X(e5, t3, r2, a2 = "lowp") {
- V(e5, [{ type: "keyword", data: "out" }, { type: "whitespace", data: " " }, { type: "keyword", data: a2 }, { type: "whitespace", data: " " }, { type: "keyword", data: r2 }, { type: "whitespace", data: " " }, { type: "ident", data: t3 }, { type: "operator", data: ";" }], "afterPrecision");
- }
- function A(e5, t3, r2, a2, o3 = "lowp") {
- V(e5, [{ type: "keyword", data: "layout" }, { type: "operator", data: "(" }, { type: "keyword", data: "location" }, { type: "whitespace", data: " " }, { type: "operator", data: "=" }, { type: "whitespace", data: " " }, { type: "integer", data: a2.toString() }, { type: "operator", data: ")" }, { type: "whitespace", data: " " }, { type: "keyword", data: "out" }, { type: "whitespace", data: " " }, { type: "keyword", data: o3 }, { type: "whitespace", data: " " }, { type: "keyword", data: r2 }, { type: "whitespace", data: " " }, { type: "ident", data: t3 }, { type: "operator", data: ";" }], "afterPrecision");
- }
- function G(e5, t3) {
- let r2, a2, o3 = -1;
- for (let n2 = t3; n2 < e5.length; n2++) {
- const t4 = e5[n2];
- if (t4.type === "operator" && (t4.data === "[" && (r2 = n2), t4.data === "]")) {
- a2 = n2;
- break;
- }
- t4.type === "integer" && (o3 = parseInt(t4.data, 10));
- }
- return r2 && a2 && e5.splice(r2, a2 - r2 + 1), o3;
- }
- function I(a2, o3) {
- const n2 = U(a2);
- if (r(n2))
- return n2;
- const i2 = j(a2);
- if (L(i2, "100", "300 es") === "300 es")
- return a2;
- let l3 = null, s2 = null;
- const c5 = {}, d2 = {};
- for (let e5 = 0; e5 < i2.length; ++e5) {
- const a3 = i2[e5];
- switch (a3.type) {
- case "keyword":
- o3 === H.VERTEX_SHADER && a3.data === "attribute" ? a3.data = "in" : a3.data === "varying" && (a3.data = o3 === H.VERTEX_SHADER ? "out" : "in");
- break;
- case "builtin":
- if (/^texture(2D|Cube)(Proj)?(Lod|Grad)?(EXT)?$/.test(a3.data.trim()) && (a3.data = a3.data.replace(/(2D|Cube|EXT)/g, "")), o3 === H.FRAGMENT_SHADER && a3.data === "gl_FragColor" && (l3 || (l3 = R(i2, c5, "fragColor"), X(i2, l3, "vec4")), a3.data = l3), o3 === H.FRAGMENT_SHADER && a3.data === "gl_FragData") {
- const t3 = G(i2, e5 + 1), r2 = R(i2, c5, "fragData");
- A(i2, r2, "vec4", t3, "mediump"), a3.data = r2;
- } else
- o3 === H.FRAGMENT_SHADER && a3.data === "gl_FragDepthEXT" && (s2 || (s2 = R(i2, c5, "gl_FragDepth")), a3.data = s2);
- break;
- case "ident":
- if (e.includes(a3.data)) {
- if (o3 === H.VERTEX_SHADER && S(i2, e5))
- throw new Error("attribute in vertex shader uses a name that is a reserved word in glsl 300 es");
- a3.data in d2 || (d2[a3.data] = R(i2, c5, a3.data)), a3.data = d2[a3.data];
- }
- }
- }
- for (let e5 = i2.length - 1; e5 >= 0; --e5) {
- const t3 = i2[e5];
- if (t3.type === "preprocessor") {
- const r2 = t3.data.match(/\#extension\s+(.*)\:/);
- if (r2 && r2[1] && F.includes(r2[1].trim())) {
- const t4 = i2[e5 + 1];
- i2.splice(e5, t4 && t4.type === "whitespace" ? 2 : 1);
- }
- const a3 = t3.data.match(/\#ifdef\s+(.*)/);
- a3 && a3[1] && F.includes(a3[1].trim()) && (t3.data = "#if 1");
- const o4 = t3.data.match(/\#ifndef\s+(.*)/);
- o4 && o4[1] && F.includes(o4[1].trim()) && (t3.data = "#if 0");
- }
- }
- return q(a2, D(i2));
- }
- var O = new Map();
- function U(e5) {
- return e2.enableCache ? O.get(e5) : null;
- }
- function q(e5, t3) {
- return e2.enableCache && O.set(e5, t3), t3;
- }
- // node_modules/@arcgis/core/views/webgl/Program.js
- var a = 4294967295;
- var h2 = class {
- constructor(t3, o3, i2, a2, h3 = new Map()) {
- this._context = t3, this._locations = a2, this._uniformBlockBindings = h3, this._refCount = 1, this._compiled = false, this._nameToUniformLocation = {}, this._nameToUniform1 = {}, this._nameToUniform1v = new Map(), this._nameToUniform2 = new Map(), this._nameToUniform3 = new Map(), this._nameToUniform4 = new Map(), this._nameToUniformMatrix3 = new Map(), this._nameToUniformMatrix4 = new Map(), t3 || console.error("RenderingContext isn't initialized!"), o3.length === 0 && console.error("Shaders source should not be empty!"), this._context.type === o.WEBGL2 && (o3 = I(o3, H.VERTEX_SHADER), i2 = I(i2, H.FRAGMENT_SHADER)), this._vShader = f2(this._context, H.VERTEX_SHADER, o3), this._fShader = f2(this._context, H.FRAGMENT_SHADER, i2), this._vShader && this._fShader || console.error("Error loading shaders!"), this._context.instanceCounter.increment(t2.Shader, this), c2() && (this.vertexShader = o3, this.fragmentShader = i2);
- }
- get glName() {
- if (r(this._glName))
- return this._glName;
- if (t(this._vShader))
- return null;
- const t3 = this._context.gl, r2 = t3.createProgram();
- if (t3.attachShader(r2, this._vShader), t3.attachShader(r2, this._fShader), this._locations.forEach((o3, i2) => t3.bindAttribLocation(r2, o3, i2)), t3.linkProgram(r2), c2() && !t3.getProgramParameter(r2, t3.LINK_STATUS) && console.error(`Could not link shader
- validated: ${t3.getProgramParameter(r2, t3.VALIDATE_STATUS)}, gl error ${t3.getError()}, vertex: ${t3.getShaderParameter(this._vShader, t3.COMPILE_STATUS)}, fragment: ${t3.getShaderParameter(this._fShader, t3.COMPILE_STATUS)}, info log: ${t3.getProgramInfoLog(r2)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`), this._context.type === o.WEBGL2) {
- const o3 = t3;
- for (const [t4, i2] of this._uniformBlockBindings) {
- const e5 = o3.getUniformBlockIndex(r2, t4);
- e5 < a && o3.uniformBlockBinding(r2, e5, i2);
- }
- }
- return this._glName = r2, this._context.instanceCounter.increment(t2.Program, this), r2;
- }
- get hasGLName() {
- return r(this._glName);
- }
- get isCompiled() {
- if (this._compiled)
- return true;
- const t3 = this._context.gl.getExtension("KHR_parallel_shader_compile");
- return t3 == null ? (this._compiled = true, true) : (this._compiled = !!this._context.gl.getProgramParameter(this.glName, t3.COMPLETION_STATUS_KHR), this._compiled);
- }
- dispose() {
- if (--this._refCount > 0)
- return;
- const t3 = this._context.gl;
- this._vShader && (t3.deleteShader(this._vShader), this._vShader = null, this._context.instanceCounter.decrement(t2.Shader, this)), this._fShader && (t3.deleteShader(this._fShader), this._fShader = null), this._glName && (t3.deleteProgram(this._glName), this._glName = null, this._context.instanceCounter.decrement(t2.Program, this));
- }
- ref() {
- ++this._refCount;
- }
- _getUniformLocation(t3) {
- return this._nameToUniformLocation[t3] === void 0 && (++l2.numUniforms, this._nameToUniformLocation[t3] = this._context.gl.getUniformLocation(this.glName, t3)), this._nameToUniformLocation[t3];
- }
- hasUniform(t3) {
- return this._getUniformLocation(t3) !== null;
- }
- setUniform1i(t3, o3) {
- const i2 = this._nameToUniform1[t3];
- i2 !== void 0 && o3 === i2 || (this._context.gl.uniform1i(this._getUniformLocation(t3), o3), this._nameToUniform1[t3] = o3);
- }
- setUniform1iv(t3, o3) {
- g2(this._nameToUniform1v, t3, o3) && this._context.gl.uniform1iv(this._getUniformLocation(t3), o3);
- }
- setUniform2iv(t3, o3) {
- g2(this._nameToUniform2, t3, o3) && this._context.gl.uniform2iv(this._getUniformLocation(t3), o3);
- }
- setUniform3iv(t3, o3) {
- g2(this._nameToUniform3, t3, o3) && this._context.gl.uniform3iv(this._getUniformLocation(t3), o3);
- }
- setUniform4iv(t3, o3) {
- g2(this._nameToUniform4, t3, o3) && this._context.gl.uniform4iv(this._getUniformLocation(t3), o3);
- }
- setUniform1f(t3, o3) {
- const i2 = this._nameToUniform1[t3];
- i2 !== void 0 && o3 === i2 || (this._context.gl.uniform1f(this._getUniformLocation(t3), o3), this._nameToUniform1[t3] = o3);
- }
- setUniform1fv(t3, o3) {
- g2(this._nameToUniform1v, t3, o3) && this._context.gl.uniform1fv(this._getUniformLocation(t3), o3);
- }
- setUniform2f(t3, o3, i2) {
- const e5 = this._nameToUniform2.get(t3);
- e5 === void 0 ? (this._context.gl.uniform2f(this._getUniformLocation(t3), o3, i2), this._nameToUniform2.set(t3, [o3, i2])) : o3 === e5[0] && i2 === e5[1] || (this._context.gl.uniform2f(this._getUniformLocation(t3), o3, i2), e5[0] = o3, e5[1] = i2);
- }
- setUniform2fv(t3, o3) {
- g2(this._nameToUniform2, t3, o3) && this._context.gl.uniform2fv(this._getUniformLocation(t3), o3);
- }
- setUniform3f(t3, o3, i2, e5) {
- const n2 = this._nameToUniform3.get(t3);
- n2 === void 0 ? (this._context.gl.uniform3f(this._getUniformLocation(t3), o3, i2, e5), this._nameToUniform3[t3] = [o3, i2, e5]) : o3 === n2[0] && i2 === n2[1] && e5 === n2[2] || (this._context.gl.uniform3f(this._getUniformLocation(t3), o3, i2, e5), n2[0] = o3, n2[1] = i2, n2[2] = e5);
- }
- setUniform3fv(t3, o3) {
- g2(this._nameToUniform3, t3, o3) && this._context.gl.uniform3fv(this._getUniformLocation(t3), o3);
- }
- setUniform4f(t3, o3, i2, e5, n2) {
- const r2 = this._nameToUniform4.get(t3);
- r2 === void 0 ? (this._context.gl.uniform4f(this._getUniformLocation(t3), o3, i2, e5, n2), this._nameToUniform4.set(t3, [o3, i2, e5, n2])) : r2 !== void 0 && o3 === r2[0] && i2 === r2[1] && e5 === r2[2] && n2 === r2[3] || (this._context.gl.uniform4f(this._getUniformLocation(t3), o3, i2, e5, n2), r2[0] = o3, r2[1] = i2, r2[2] = e5, r2[3] = n2);
- }
- setUniform4fv(t3, o3) {
- g2(this._nameToUniform4, t3, o3) && this._context.gl.uniform4fv(this._getUniformLocation(t3), o3);
- }
- setUniformMatrix3fv(t3, o3, i2 = false) {
- g2(this._nameToUniformMatrix3, t3, o3) && this._context.gl.uniformMatrix3fv(this._getUniformLocation(t3), i2, o3);
- }
- setUniformMatrix4fv(t3, o3, i2 = false) {
- g2(this._nameToUniformMatrix4, t3, o3) && this._context.gl.uniformMatrix4fv(this._getUniformLocation(t3), i2, o3);
- }
- stop() {
- }
- };
- function f2(t3, o3, i2) {
- const n2 = t3.gl, s2 = n2.createShader(o3);
- return n2.shaderSource(s2, i2), n2.compileShader(s2), c2() && !n2.getShaderParameter(s2, n2.COMPILE_STATUS) && (console.error("Compile error in ".concat(o3 === H.VERTEX_SHADER ? "vertex" : "fragment", " shader")), console.error(n2.getShaderInfoLog(s2)), console.error(_2(i2))), l2.enabled && (l2.compiledLOC += i2.match(/\n/g).length + 1), s2;
- }
- function _2(t3) {
- let o3 = 2;
- return t3.replace(/\n/g, () => "\n" + c4(o3++) + ":");
- }
- function c4(t3) {
- return t3 >= 1e3 ? t3.toString() : (" " + t3).slice(-3);
- }
- function g2(o3, i2, e5) {
- const n2 = o3.get(i2);
- return n2 ? c(n2, e5) : (o3.set(i2, Array.from(e5)), true);
- }
- var l2 = { compiledLOC: 0, numUniforms: 0, enabled: false };
- // node_modules/@arcgis/core/views/webgl/ShaderCompiler.js
- var e3 = class {
- constructor(e5) {
- this.readFile = e5;
- }
- resolveIncludes(e5) {
- return this._resolve(e5);
- }
- _resolve(e5, t3 = new Map()) {
- if (t3.has(e5))
- return t3.get(e5);
- const r2 = this._read(e5);
- if (!r2)
- throw new Error(`cannot find shader file ${e5}`);
- const s2 = /^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;
- let n2 = s2.exec(r2);
- const l3 = [];
- for (; n2 != null; )
- l3.push({ path: n2[1], start: n2.index, length: n2[0].length }), n2 = s2.exec(r2);
- let a2 = 0, h3 = "";
- return l3.forEach((e6) => {
- h3 += r2.slice(a2, e6.start), h3 += t3.has(e6.path) ? "" : this._resolve(e6.path, t3), a2 = e6.start + e6.length;
- }), h3 += r2.slice(a2), t3.set(e5, h3), h3;
- }
- _read(e5) {
- return this.readFile(e5);
- }
- };
- // node_modules/@arcgis/core/views/webgl/ProgramTemplate.js
- function e4(e5, t3, a2 = "") {
- return new h2(e5, a2 + t3.shaders.vertexShader, a2 + t3.shaders.fragmentShader, t3.attributes);
- }
- export {
- h2 as h,
- e3 as e,
- e4 as e2
- };
- //# sourceMappingURL=chunk-JH3PLIM6.js.map
|