You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
140 lines
74 KiB
140 lines
74 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
require({cache:{"esri/views/webgl/BufferObject":function(){define("exports ../../core/arrayUtils ../../core/has ../../core/Logger ../../core/typedArrayUtil ./checkWebGLError ./enums".split(" "),function(c,a,y,e,n,z,h){class m{static createIndex(w,v,d){return new m(w,h.BufferType.ELEMENT_ARRAY_BUFFER,v,d)}static createVertex(w,v,d){return new m(w,h.BufferType.ARRAY_BUFFER,v,d)}static createUniform(w,v,d){return new m(w,h.BufferType.UNIFORM_BUFFER,v,d)}static createPixelPack(w,v=h.Usage.STREAM_READ, |
|
d){w=new m(w,h.BufferType.PIXEL_PACK_BUFFER,v);d&&w.setSize(d);return w}static createPixelUnpack(w,v=h.Usage.STREAM_DRAW,d){return new m(w,h.BufferType.PIXEL_UNPACK_BUFFER,v,d)}static createTransformFeedback(w,v=h.Usage.STATIC_DRAW,d){w=new m(w,h.BufferType.TRANSFORM_FEEDBACK_BUFFER,v);w.setSize(d);return w}constructor(w,v,d,k){this._context=w;this.bufferType=v;this.usage=d;this._glName=null;this._size=-1;this._indexType=void 0;w.instanceCounter.increment(h.ResourceType.BufferObject,this);this._glName= |
|
this._context.gl.createBuffer();z.checkWebGLError(this._context.gl);k&&this.setData(k)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){return this.bufferType===h.BufferType.ELEMENT_ARRAY_BUFFER?this._indexType===h.DataType.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===h.BufferType.ELEMENT_ARRAY_BUFFER||this.bufferType===h.BufferType.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&& |
|
(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(h.ResourceType.BufferObject,this),this._context=null):this._glName&&e.getLogger("esri.views.webgl.BufferObject").warn("Leaked WebGL buffer object")}setSize(w,v=null){if(this.bufferType===h.BufferType.ELEMENT_ARRAY_BUFFER&&null!=v)switch(this._indexType=v,v){case h.DataType.UNSIGNED_SHORT:w*=2;break;case h.DataType.UNSIGNED_INT:w*=4}this._setBufferData(w)}setData(w){if(w){var v=w.byteLength;this.bufferType=== |
|
h.BufferType.ELEMENT_ARRAY_BUFFER&&(n.isUint16Array(w)&&(v/=2,this._indexType=h.DataType.UNSIGNED_SHORT),n.isUint32Array(w)&&(v/=4,this._indexType=h.DataType.UNSIGNED_INT));this._setBufferData(v,w)}}_setBufferData(w,v=null){this._size=w;const d=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null);this._context.bindBuffer(this);const k=this._context.gl;null!=v?k.bufferData(this.bufferType,v,this.usage):k.bufferData(this.bufferType,w,this.usage);z.checkWebGLError(k);this._isVAOAware&& |
|
this._context.bindVAO(d)}setSubData(w,v,d,k){if(w){var q=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null);this._context.bindBuffer(this);var {gl:A}=this._context;A.bufferSubData(this.bufferType,v*w.BYTES_PER_ELEMENT,w,d,k-d);z.checkWebGLError(A);this._isVAOAware&&this._context.bindVAO(q)}}getSubData(w,v=0,d,k){if(!(0>d||0>k)){var q=a.isArrayLike(w)?w.BYTES_PER_ELEMENT:1;q*((d??0)+(k??0))>w.byteLength||(v+q*(k??0)>this.usedMemory&&e.getLogger("esri.views.webgl.BufferObject").warn("Potential problem getting subdata: requested data exceeds buffer size!"), |
|
q=this._context.gl,this.bufferType===h.BufferType.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,h.BufferType.TRANSFORM_FEEDBACK_BUFFER),q.getBufferSubData(h.BufferType.TRANSFORM_FEEDBACK_BUFFER,v,w,d,k),this._context.unbindBuffer(h.BufferType.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,h.BufferType.COPY_READ_BUFFER),q.getBufferSubData(h.BufferType.COPY_READ_BUFFER,v,w,d,k),this._context.unbindBuffer(h.BufferType.COPY_READ_BUFFER)))}}async getSubDataAsync(w,v=0,d,k){await this._context.clientWaitAsync(); |
|
this.getSubData(w,v,d,k)}}c.BufferObject=m;c.tracer=null;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/checkWebGLError":function(){define(["exports","../../core/Error","../../core/has","../../core/Logger"],function(c,a,y,e){function n(h,m){switch(m){case h.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case h.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case h.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state."; |
|
case h.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case h.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case h.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const z=!!y("enable-feature:webgl-debug");c.checkWebGLError=function(h){if(z){var m=h.getError();m&&(h=n(h,m),m=Error().stack,e.getLogger("esri.views.webgl.checkWebGLError").error(new a("webgl-error", |
|
"WebGL error occurred",{message:h,stack:m})))}};c.hasFeatureFlagWebGLDebug=z;c.webglDebugEnabled=function(){return z};c.webglValidateShadersEnabled=function(){return z};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/enums":function(){define(["exports"],function(c){c.ClearBufferBit=void 0;(function(a){a[a.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT";a[a.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT";a[a.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"})(c.ClearBufferBit||(c.ClearBufferBit= |
|
{}));c.PrimitiveType=void 0;(function(a){a[a.POINTS=0]="POINTS";a[a.LINES=1]="LINES";a[a.LINE_LOOP=2]="LINE_LOOP";a[a.LINE_STRIP=3]="LINE_STRIP";a[a.TRIANGLES=4]="TRIANGLES";a[a.TRIANGLE_STRIP=5]="TRIANGLE_STRIP";a[a.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(c.PrimitiveType||(c.PrimitiveType={}));c.BlendFactor=void 0;(function(a){a[a.ZERO=0]="ZERO";a[a.ONE=1]="ONE";a[a.SRC_COLOR=768]="SRC_COLOR";a[a.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR";a[a.SRC_ALPHA=770]="SRC_ALPHA";a[a.ONE_MINUS_SRC_ALPHA=771]= |
|
"ONE_MINUS_SRC_ALPHA";a[a.DST_ALPHA=772]="DST_ALPHA";a[a.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA";a[a.DST_COLOR=774]="DST_COLOR";a[a.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR";a[a.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE";a[a.CONSTANT_COLOR=32769]="CONSTANT_COLOR";a[a.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR";a[a.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA";a[a.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"})(c.BlendFactor||(c.BlendFactor={}));c.BlendOperation= |
|
void 0;(function(a){a[a.ADD=32774]="ADD";a[a.MIN=32775]="MIN";a[a.MAX=32776]="MAX";a[a.SUBTRACT=32778]="SUBTRACT";a[a.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"})(c.BlendOperation||(c.BlendOperation={}));c.BufferType=void 0;(function(a){a[a.ARRAY_BUFFER=34962]="ARRAY_BUFFER";a[a.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER";a[a.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER";a[a.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER";a[a.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER";a[a.COPY_READ_BUFFER=36662]= |
|
"COPY_READ_BUFFER";a[a.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER";a[a.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER"})(c.BufferType||(c.BufferType={}));c.Face=void 0;(function(a){a[a.FRONT=1028]="FRONT";a[a.BACK=1029]="BACK";a[a.FRONT_AND_BACK=1032]="FRONT_AND_BACK"})(c.Face||(c.Face={}));c.CullMode=void 0;(function(a){a[a.CW=2304]="CW";a[a.CCW=2305]="CCW"})(c.CullMode||(c.CullMode={}));c.DataType=void 0;(function(a){a[a.BYTE=5120]="BYTE";a[a.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE";a[a.SHORT= |
|
5122]="SHORT";a[a.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT";a[a.INT=5124]="INT";a[a.UNSIGNED_INT=5125]="UNSIGNED_INT";a[a.FLOAT=5126]="FLOAT";a[a.HALF_FLOAT=5131]="HALF_FLOAT"})(c.DataType||(c.DataType={}));c.CompareFunction=void 0;(function(a){a[a.NEVER=512]="NEVER";a[a.LESS=513]="LESS";a[a.EQUAL=514]="EQUAL";a[a.LEQUAL=515]="LEQUAL";a[a.GREATER=516]="GREATER";a[a.NOTEQUAL=517]="NOTEQUAL";a[a.GEQUAL=518]="GEQUAL";a[a.ALWAYS=519]="ALWAYS"})(c.CompareFunction||(c.CompareFunction={}));c.StencilOperation= |
|
void 0;(function(a){a[a.ZERO=0]="ZERO";a[a.KEEP=7680]="KEEP";a[a.REPLACE=7681]="REPLACE";a[a.INCR=7682]="INCR";a[a.DECR=7683]="DECR";a[a.INVERT=5386]="INVERT";a[a.INCR_WRAP=34055]="INCR_WRAP";a[a.DECR_WRAP=34056]="DECR_WRAP"})(c.StencilOperation||(c.StencilOperation={}));c.TextureSamplingMode=void 0;(function(a){a[a.NEAREST=9728]="NEAREST";a[a.LINEAR=9729]="LINEAR";a[a.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST";a[a.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST";a[a.NEAREST_MIPMAP_LINEAR= |
|
9986]="NEAREST_MIPMAP_LINEAR";a[a.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"})(c.TextureSamplingMode||(c.TextureSamplingMode={}));c.TextureWrapMode=void 0;(function(a){a[a.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE";a[a.REPEAT=10497]="REPEAT";a[a.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(c.TextureWrapMode||(c.TextureWrapMode={}));c.TextureType=void 0;(function(a){a[a.TEXTURE_2D=3553]="TEXTURE_2D";a[a.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP";a[a.TEXTURE_3D=32879]="TEXTURE_3D";a[a.TEXTURE_CUBE_MAP_POSITIVE_X= |
|
34069]="TEXTURE_CUBE_MAP_POSITIVE_X";a[a.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X";a[a.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y";a[a.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y";a[a.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z";a[a.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z";a[a.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"})(c.TextureType||(c.TextureType={}));c.PixelFormat=void 0;(function(a){a[a.DEPTH_COMPONENT= |
|
6402]="DEPTH_COMPONENT";a[a.DEPTH_STENCIL=34041]="DEPTH_STENCIL";a[a.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8";a[a.ALPHA=6406]="ALPHA";a[a.RGB=6407]="RGB";a[a.RGBA=6408]="RGBA";a[a.LUMINANCE=6409]="LUMINANCE";a[a.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA";a[a.RED=6403]="RED";a[a.RG=33319]="RG";a[a.RED_INTEGER=36244]="RED_INTEGER";a[a.RG_INTEGER=33320]="RG_INTEGER";a[a.RGB_INTEGER=36248]="RGB_INTEGER";a[a.RGBA_INTEGER=36249]="RGBA_INTEGER"})(c.PixelFormat||(c.PixelFormat={}));c.SizedPixelFormat=void 0; |
|
(function(a){a[a.RGBA4=32854]="RGBA4";a[a.R16F=33325]="R16F";a[a.RG16F=33327]="RG16F";a[a.RGB32F=34837]="RGB32F";a[a.RGBA16F=34842]="RGBA16F";a[a.R32F=33326]="R32F";a[a.RG32F=33328]="RG32F";a[a.RGBA32F=34836]="RGBA32F";a[a.R11F_G11F_B10F=35898]="R11F_G11F_B10F";a[a.RGB8=32849]="RGB8";a[a.RGBA8=32856]="RGBA8";a[a.RGB5_A1=32855]="RGB5_A1";a[a.R8=33321]="R8";a[a.RG8=33323]="RG8";a[a.R8I=33329]="R8I";a[a.R8UI=33330]="R8UI";a[a.R16I=33331]="R16I";a[a.R16UI=33332]="R16UI";a[a.R32I=33333]="R32I";a[a.R32UI= |
|
33334]="R32UI";a[a.RG8I=33335]="RG8I";a[a.RG8UI=33336]="RG8UI";a[a.RG16I=33337]="RG16I";a[a.RG16UI=33338]="RG16UI";a[a.RG32I=33339]="RG32I";a[a.RG32UI=33340]="RG32UI";a[a.RGB16F=34843]="RGB16F";a[a.RGB9_E5=35901]="RGB9_E5";a[a.SRGB8=35905]="SRGB8";a[a.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8";a[a.RGB565=36194]="RGB565";a[a.RGBA32UI=36208]="RGBA32UI";a[a.RGB32UI=36209]="RGB32UI";a[a.RGBA16UI=36214]="RGBA16UI";a[a.RGB16UI=36215]="RGB16UI";a[a.RGBA8UI=36220]="RGBA8UI";a[a.RGB8UI=36221]="RGB8UI";a[a.RGBA32I= |
|
36226]="RGBA32I";a[a.RGB32I=36227]="RGB32I";a[a.RGBA16I=36232]="RGBA16I";a[a.RGB16I=36233]="RGB16I";a[a.RGBA8I=36238]="RGBA8I";a[a.RGB8I=36239]="RGB8I";a[a.R8_SNORM=36756]="R8_SNORM";a[a.RG8_SNORM=36757]="RG8_SNORM";a[a.RGB8_SNORM=36758]="RGB8_SNORM";a[a.RGBA8_SNORM=36759]="RGBA8_SNORM";a[a.RGB10_A2=32857]="RGB10_A2";a[a.RGB10_A2UI=36975]="RGB10_A2UI"})(c.SizedPixelFormat||(c.SizedPixelFormat={}));c.PixelType=void 0;(function(a){a[a.FLOAT=5126]="FLOAT";a[a.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE";a[a.UNSIGNED_INT_24_8= |
|
34042]="UNSIGNED_INT_24_8";a[a.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4";a[a.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1";a[a.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5";a[a.BYTE=5120]="BYTE";a[a.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT";a[a.SHORT=5122]="SHORT";a[a.UNSIGNED_INT=5125]="UNSIGNED_INT";a[a.INT=5124]="INT";a[a.HALF_FLOAT=5131]="HALF_FLOAT";a[a.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV";a[a.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV"; |
|
a[a.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV";a[a.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"})(c.PixelType||(c.PixelType={}));c.RenderbufferFormat=void 0;(function(a){a[a.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16";a[a.STENCIL_INDEX8=36168]="STENCIL_INDEX8";a[a.DEPTH_STENCIL=34041]="DEPTH_STENCIL";a[a.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24";a[a.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F";a[a.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8";a[a.DEPTH32F_STENCIL8= |
|
36013]="DEPTH32F_STENCIL8"})(c.RenderbufferFormat||(c.RenderbufferFormat={}));c.Usage=void 0;(function(a){a[a.STATIC_DRAW=35044]="STATIC_DRAW";a[a.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW";a[a.STREAM_DRAW=35040]="STREAM_DRAW";a[a.STATIC_READ=35045]="STATIC_READ";a[a.DYNAMIC_READ=35049]="DYNAMIC_READ";a[a.STREAM_READ=35041]="STREAM_READ";a[a.STATIC_COPY=35046]="STATIC_COPY";a[a.DYNAMIC_COPY=35050]="DYNAMIC_COPY";a[a.STREAM_COPY=35042]="STREAM_COPY"})(c.Usage||(c.Usage={}));c.ShaderType=void 0;(function(a){a[a.FRAGMENT_SHADER= |
|
35632]="FRAGMENT_SHADER";a[a.VERTEX_SHADER=35633]="VERTEX_SHADER"})(c.ShaderType||(c.ShaderType={}));c.FramebufferTarget=void 0;(function(a){a[a.FRAMEBUFFER=36160]="FRAMEBUFFER";a[a.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER";a[a.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"})(c.FramebufferTarget||(c.FramebufferTarget={}));c.ResourceType=void 0;(function(a){a[a.Texture=0]="Texture";a[a.BufferObject=1]="BufferObject";a[a.VertexArrayObject=2]="VertexArrayObject";a[a.Shader=3]="Shader";a[a.Program=4]="Program"; |
|
a[a.FramebufferObject=5]="FramebufferObject";a[a.Renderbuffer=6]="Renderbuffer";a[a.TransformFeedback=7]="TransformFeedback";a[a.Sync=8]="Sync";a[a.UNCOUNTED=9]="UNCOUNTED";a[a.LinesOfCode=9]="LinesOfCode";a[a.Uniform=10]="Uniform";a[a.COUNT=11]="COUNT"})(c.ResourceType||(c.ResourceType={}));c.ColorAttachment=void 0;(function(a){a[a.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0";a[a.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1";a[a.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2";a[a.COLOR_ATTACHMENT3=36067]= |
|
"COLOR_ATTACHMENT3";a[a.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4";a[a.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5";a[a.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6";a[a.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7";a[a.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8";a[a.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9";a[a.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10";a[a.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11";a[a.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12";a[a.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13"; |
|
a[a.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14";a[a.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15"})(c.ColorAttachment||(c.ColorAttachment={}));c.SpecialDrawBuffers=void 0;(function(a){a[a.NONE=0]="NONE";a[a.BACK=1029]="BACK"})(c.SpecialDrawBuffers||(c.SpecialDrawBuffers={}));c.CompressedTextureFormat=void 0;(function(a){a[a.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT";a[a.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT";a[a.COMPRESSED_RGBA_S3TC_DXT3_EXT= |
|
33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT";a[a.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT";a[a.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC";a[a.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC";a[a.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC";a[a.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC";a[a.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2";a[a.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2";a[a.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2= |
|
37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2";a[a.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2";a[a.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC";a[a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"})(c.CompressedTextureFormat||(c.CompressedTextureFormat={}));c.UniformType=void 0;(function(a){a[a.FLOAT=5126]="FLOAT";a[a.FLOAT_VEC2=35664]="FLOAT_VEC2";a[a.FLOAT_VEC3=35665]="FLOAT_VEC3";a[a.FLOAT_VEC4=35666]= |
|
"FLOAT_VEC4";a[a.INT=5124]="INT";a[a.INT_VEC2=35667]="INT_VEC2";a[a.INT_VEC3=35668]="INT_VEC3";a[a.INT_VEC4=35669]="INT_VEC4";a[a.BOOL=35670]="BOOL";a[a.BOOL_VEC2=35671]="BOOL_VEC2";a[a.BOOL_VEC3=35672]="BOOL_VEC3";a[a.BOOL_VEC4=35673]="BOOL_VEC4";a[a.FLOAT_MAT2=35674]="FLOAT_MAT2";a[a.FLOAT_MAT3=35675]="FLOAT_MAT3";a[a.FLOAT_MAT4=35676]="FLOAT_MAT4";a[a.SAMPLER_2D=35678]="SAMPLER_2D";a[a.SAMPLER_CUBE=35680]="SAMPLER_CUBE";a[a.UNSIGNED_INT=5125]="UNSIGNED_INT";a[a.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2"; |
|
a[a.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3";a[a.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4";a[a.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3";a[a.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4";a[a.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2";a[a.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4";a[a.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2";a[a.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3";a[a.SAMPLER_3D=35679]="SAMPLER_3D";a[a.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW";a[a.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY";a[a.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW"; |
|
a[a.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW";a[a.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D";a[a.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D";a[a.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE";a[a.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY";a[a.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D";a[a.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D";a[a.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE";a[a.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"})(c.UniformType|| |
|
(c.UniformType={}));c.SyncParameter=void 0;(function(a){a[a.OBJECT_TYPE=37138]="OBJECT_TYPE";a[a.SYNC_CONDITION=37139]="SYNC_CONDITION";a[a.SYNC_STATUS=37140]="SYNC_STATUS";a[a.SYNC_FLAGS=37141]="SYNC_FLAGS"})(c.SyncParameter||(c.SyncParameter={}));c.SyncStatus=void 0;(function(a){a[a.UNSIGNALED=37144]="UNSIGNALED";a[a.SIGNALED=37145]="SIGNALED"})(c.SyncStatus||(c.SyncStatus={}));c.ClientWaitSyncStatus=void 0;(function(a){a[a.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED";a[a.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED"; |
|
a[a.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED";a[a.WAIT_FAILED=37149]="WAIT_FAILED"})(c.ClientWaitSyncStatus||(c.ClientWaitSyncStatus={}));c.SyncCondition=void 0;(function(a){a[a.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"})(c.SyncCondition||(c.SyncCondition={}));c.SyncFlag=void 0;(function(a){a[a.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"})(c.SyncFlag||(c.SyncFlag={}));c.DepthStencilAttachment=33306;c.baseTextureUnit=33984;Object.defineProperty(c,Symbol.toStringTag, |
|
{value:"Module"})})},"esri/views/webgl/FramebufferObject":function(){define("exports ../../core/has ../../core/Logger ../../core/maybe ./BufferObject ./checkWebGLError ./enums ./GLObjectType ./Renderbuffer ./Texture".split(" "),function(c,a,y,e,n,z,h,m,w,v){function d(f){return null!=f&&"type"in f&&f.type===m.GLObjectType.Texture}function k(f,x){const g=Math.max(f.width,f.height);return g>x?(y.getLogger("esri.views.webgl.FramebufferObject").warn(`Resizing FBO attachment size ${f.width}x${f.height} to device limit ${x}`), |
|
x/=g,f.width=Math.round(f.width*x),f.height=Math.round(f.height*x),!1):!0}function q(f){return f.descriptor.target===h.TextureType.TEXTURE_CUBE_MAP?h.TextureType.TEXTURE_CUBE_MAP_POSITIVE_X:h.TextureType.TEXTURE_2D}class A{constructor(f,x,g=null){this._context=f;this._glName=null;this._colorAttachments=new Map;this._depthStencilTexture=this._depthStencilBuffer=null;this._initialized=!1;f.instanceCounter.increment(h.ResourceType.FramebufferObject,this);f=d(x)?x:new v.Texture(this._context,x);this._colorAttachments.set(h.ColorAttachment.COLOR_ATTACHMENT0, |
|
f);this._validateTextureDescriptor(f.descriptor);this._validateColorAttachmentPoint(h.ColorAttachment.COLOR_ATTACHMENT0);null!=g&&(d(g)||null!=g&&"pixelFormat"in g?(this._depthStencilTexture=d(g)?g:new v.Texture(this._context,g),this._validateTextureDescriptor(this._depthStencilTexture.descriptor)):(this._depthStencilBuffer=g=null!=g&&"type"in g&&g.type===m.GLObjectType.RenderBuffer?g:new w.Renderbuffer(this._context,g),this._validateRenderBufferDescriptor(g.descriptor)))}dispose(){if(0!==this._colorAttachments.size|| |
|
this._glName){var f=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((x,g)=>this.detachColorTexture(g)?.dispose());this.detachDepthStencilBuffer()?.dispose();this.detachDepthStencilTexture()?.dispose();this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null);this._context.bindFramebuffer(f);this._context.instanceCounter.decrement(h.ResourceType.FramebufferObject,this)}}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(h.ColorAttachment.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture|| |
|
this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._colorAttachments.get(h.ColorAttachment.COLOR_ATTACHMENT0)?.descriptor?.width??0}get height(){return this._colorAttachments.get(h.ColorAttachment.COLOR_ATTACHMENT0)?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((f,[,x])=>f+x.usedMemory,this.depthStencil?.usedMemory??0)}getColorTexture(f){return(f=this._colorAttachments.get(f))&&d(f)?f:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(f, |
|
x=h.ColorAttachment.COLOR_ATTACHMENT0){f&&(this._validateColorAttachmentPoint(x),this._validateTextureDescriptor(f.descriptor),this.detachColorTexture(x)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(f.glName,x)),this._colorAttachments.set(x,f))}detachColorTexture(f=h.ColorAttachment.COLOR_ATTACHMENT0){const x=this._colorAttachments.get(f);if(x){if(this._initialized){const g=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this); |
|
this._framebufferTexture2D(null,f);this._context.bindFramebuffer(g)}this._colorAttachments.delete(f);return x}}setColorTextureTarget(f,x=h.ColorAttachment.COLOR_ATTACHMENT0){const g=this._colorAttachments.get(x);g&&this._framebufferTexture2D(g.glName,x,f)}attachDepthStencil(f){if(f)switch(f.type){case m.GLObjectType.Texture:return this._attachDepthStencilTexture(f);case m.GLObjectType.RenderBuffer:return this._attachDepthStencilBuffer(f)}}_attachDepthStencilTexture(f){if(null!=f){var x=f.descriptor; |
|
x.pixelFormat!==h.PixelFormat.DEPTH_STENCIL&&x.pixelFormat!==h.PixelFormat.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!");x.dataType!==h.PixelType.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!");this._validateTextureDescriptor(x);this._disposeDepthStencilAttachments();this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(f.glName,h.DepthStencilAttachment));this._depthStencilTexture?.dispose(); |
|
this._depthStencilTexture=f}}detachDepthStencilTexture(){const f=this._depthStencilTexture;if(f&&this._initialized){const x=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);this._framebufferTexture2D(null,h.DepthStencilAttachment);this._context.bindFramebuffer(x)}this._depthStencilTexture=null;return f}_attachDepthStencilBuffer(f){if(null!=f){var x=f.descriptor;this._validateRenderBufferDescriptor(x);this._disposeDepthStencilAttachments();if(this._initialized){this._context.bindFramebuffer(this); |
|
const g=this._context.gl;x=this._getGLAttachmentPoint(x);g.framebufferRenderbuffer(h.FramebufferTarget.FRAMEBUFFER,x,g.RENDERBUFFER,f.glName)}this._depthStencilBuffer=f}}detachDepthStencilBuffer(){const f=this._depthStencilBuffer;if(f&&this._initialized){const x=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);const g=this._context.gl,b=this._getGLAttachmentPoint(f.descriptor);g.framebufferRenderbuffer(h.FramebufferTarget.FRAMEBUFFER,b,g.RENDERBUFFER,null);this._context.bindFramebuffer(x)}this._depthStencilBuffer= |
|
null;return f}copyToTexture(f,x,g,b,l,p,r){(0>f||0>x||0>l||0>p)&&console.error("Offsets cannot be negative!");(0>=g||0>=b)&&console.error("Copy width and height must be greater than zero!");var E=r.descriptor;r.descriptor.target!==h.TextureType.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!");(null==E?.width||null==E?.height||f+g>this.width||x+b>this.height||l+g>E.width||p+b>E.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!"); |
|
E=this._context;r=E.bindTexture(r,v.Texture.TEXTURE_UNIT_FOR_UPDATES);E.setActiveTexture(v.Texture.TEXTURE_UNIT_FOR_UPDATES);E.bindFramebuffer(this);E.gl.copyTexSubImage2D(h.TextureType.TEXTURE_2D,0,l,p,f,x,g,b);E.bindTexture(r,v.Texture.TEXTURE_UNIT_FOR_UPDATES)}readPixels(f,x,g,b,l,p,r){(0>=g||0>=b)&&console.error("Copy width and height must be greater than zero!");r||console.error("Target memory is not initialized!");this._context.bindFramebuffer(this);this._context.gl.readPixels(f,x,g,b,l,p,r)}async readPixelsAsync(f, |
|
x,g,b,l,p,r){const {gl:E}=this._context,G=n.BufferObject.createPixelPack(this._context,h.Usage.STREAM_READ,r.byteLength);this._context.bindBuffer(G);this._context.bindFramebuffer(this);E.readPixels(f,x,g,b,l,p,0);this._context.unbindBuffer(h.BufferType.PIXEL_PACK_BUFFER);await G.getSubDataAsync(r);G.dispose()}resize(f,x){if(this.width!==f||this.height!==x){var g={width:f,height:x};k(g,this._context.parameters.maxTextureSize);this._colorAttachments.forEach(b=>b.resize(g.width,g.height));this._depthStencilTexture?.resize(g.width, |
|
g.height);this._initialized&&(k(g,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(g.width,g.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}}initializeAndBind(f=h.FramebufferTarget.FRAMEBUFFER){const x=this._context.gl;if(this._initialized)x.bindFramebuffer(f,this.glName);else{this._glName&&x.deleteFramebuffer(this._glName);var g=x.createFramebuffer();x.bindFramebuffer(f,g);this._colorAttachments.forEach((b, |
|
l)=>this._framebufferTexture2D(b.glName,l,q(b),f));if(this._depthStencilBuffer){const b=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);x.framebufferRenderbuffer(f,b,x.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,x.DEPTH_STENCIL_ATTACHMENT,q(this._depthStencilTexture),f);z.webglDebugEnabled()&&x.checkFramebufferStatus(f)!==x.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"); |
|
this._glName=g;this._initialized=!0}}_framebufferTexture2D(f,x=h.ColorAttachment.COLOR_ATTACHMENT0,g=h.TextureType.TEXTURE_2D,b=h.FramebufferTarget.FRAMEBUFFER,l=0){this._context.gl.framebufferTexture2D(b,x,g,f,l)}_disposeDepthStencilAttachments(){const f=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const x=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);f.framebufferRenderbuffer(h.FramebufferTarget.FRAMEBUFFER,x,f.RENDERBUFFER, |
|
null)}this._depthStencilBuffer=e.disposeMaybe(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,f.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=e.disposeMaybe(this._depthStencilTexture))}_validateTextureDescriptor(f){f.target!==h.TextureType.TEXTURE_2D&&f.target!==h.TextureType.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!");k(f,this._context.parameters.maxTextureSize); |
|
this._validateBufferDimensions(f)}_validateRenderBufferDescriptor(f){k(f,this._context.parameters.maxRenderbufferSize);this._validateBufferDimensions(f)}_validateBufferDimensions(f){0>=f.width&&(f.width=this.width);0>=f.height&&(f.height=this.height);0<this.width&&0<this.height&&(this.width!==f.width||this.height!==f.height)&&console.error("Attachment size must match framebuffer size!")}_getGLAttachmentPoint(f){switch(f.internalFormat){case h.RenderbufferFormat.DEPTH_COMPONENT16:case h.RenderbufferFormat.DEPTH_COMPONENT24:case h.RenderbufferFormat.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT; |
|
case h.RenderbufferFormat.DEPTH24_STENCIL8:case h.RenderbufferFormat.DEPTH32F_STENCIL8:case h.RenderbufferFormat.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case h.RenderbufferFormat.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(f){if(-1===A._MAX_COLOR_ATTACHMENTS){const {gl:x}=this._context;A._MAX_COLOR_ATTACHMENTS=x.getParameter(x.MAX_COLOR_ATTACHMENTS)}f-=h.ColorAttachment.COLOR_ATTACHMENT0;f+1>A._MAX_COLOR_ATTACHMENTS&&y.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject", |
|
`illegal attachment point for color attachment: ${f+1}. Implementation supports up to ${A._MAX_COLOR_ATTACHMENTS} color attachments`)}}A._MAX_COLOR_ATTACHMENTS=-1;c.FramebufferObject=A;c.ensureAttachmentMaxSize=k;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/GLObjectType":function(){define(["exports"],function(c){c.GLObjectType=void 0;var a=c.GLObjectType||(c.GLObjectType={});a[a.Texture=0]="Texture";a[a.RenderBuffer=1]="RenderBuffer";Object.defineProperty(c,Symbol.toStringTag, |
|
{value:"Module"})})},"esri/views/webgl/Renderbuffer":function(){define(["exports","./enums","./GLObjectType","./RenderbufferDescriptor"],function(c,a,y,e){class n{constructor(z,h){this._context=z;this._descriptor=h;this.type=y.GLObjectType.RenderBuffer;this._context.instanceCounter.increment(a.ResourceType.Renderbuffer,this);z=this._context.gl;this.glName=z.createRenderbuffer();this._context.bindRenderbuffer(this);const {width:m,height:w,internalFormat:v,multisampled:d}=h;d?z.renderbufferStorageMultisample(z.RENDERBUFFER, |
|
this.samples,v,m,w):z.renderbufferStorage(z.RENDERBUFFER,v,m,w);this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const z=this._descriptor.samples,h=this._context.parameters.maxSamples;return z?Math.min(z,h):h}get usedMemory(){return e.estimateMemory(this._descriptor)}resize(z,h){const m=this._descriptor;if(m.width!==z||m.height!==h)m.width=z,m.height=h,z=this._context.gl,this._context.bindRenderbuffer(this),m.multisampled?z.renderbufferStorageMultisample(z.RENDERBUFFER, |
|
this.samples,m.internalFormat,m.width,m.height):z.renderbufferStorage(z.RENDERBUFFER,m.internalFormat,m.width,m.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(a.ResourceType.Renderbuffer,this),this._context=null)}}c.Renderbuffer=n;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/RenderbufferDescriptor":function(){define(["exports","./Util"],function(c,a){class y{constructor(e, |
|
n,z=n){this.internalFormat=e;this.width=n;this.height=z;this.multisampled=!1;this.samples=1}}c.RenderbufferDescriptor=y;c.estimateMemory=function(e){return 0>=e.width||0>=e.height||null==e.internalFormat?0:e.width*e.height*a.getBytesPerElementFormat(e.internalFormat)};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Util":function(){define(["exports","../../core/has","./checkWebGLError","./enums","./getDataTypeBytes"],function(c,a,y,e,n){function z(m){m=m.gl;switch(m.getError()){case m.NO_ERROR:return null; |
|
case m.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case m.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case m.INVALID_OPERATION:return"The specified command is not allowed for the current state";case m.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case m.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case m.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"} |
|
function h(m){return m[0].stride}c.bindVertexBufferLayout=function(m,w,v,d,k=0){const q=m.gl;m.bindBuffer(v);for(const f of d)if(d=w.get(f.name),void 0===d)console.warn(`There is no location for vertex attribute '${f.name}' defined.`);else{v=k*f.stride;if(4>=f.count)q.vertexAttribPointer(d,f.count,f.type,f.normalized,f.stride,f.offset+v),q.enableVertexAttribArray(d),0<f.divisor&&m.gl.vertexAttribDivisor(d,f.divisor);else if(9===f.count)for(var A=0;3>A;A++)q.vertexAttribPointer(d+A,3,f.type,f.normalized, |
|
f.stride,f.offset+12*A+v),q.enableVertexAttribArray(d+A),0<f.divisor&&m.gl.vertexAttribDivisor(d+A,f.divisor);else if(16===f.count)for(A=0;4>A;A++)q.vertexAttribPointer(d+A,4,f.type,f.normalized,f.stride,f.offset+16*A+v),q.enableVertexAttribArray(d+A),0<f.divisor&&m.gl?.vertexAttribDivisor(d+A,f.divisor);else console.error("Unsupported vertex attribute element count: "+f.count);if(y.webglDebugEnabled()){d=z(m);A=n.getDataTypeBytes(f.type);const x=f.offset;A=Math.round(A/x)!==A/x?`. Offset not a multiple of stride. DataType requires ${A} bytes, but descriptor has an offset of ${x}`: |
|
"";d&&console.error(`Unable to bind vertex attribute "${f.name}" with baseInstanceOffset ${v}${A}:`,d,f)}}};c.getBytesPerElementFormat=function(m){switch(m){case e.PixelFormat.ALPHA:case e.PixelFormat.LUMINANCE:case e.PixelFormat.RED:case e.PixelFormat.RED_INTEGER:case e.SizedPixelFormat.R8:case e.SizedPixelFormat.R8I:case e.SizedPixelFormat.R8UI:case e.SizedPixelFormat.R8_SNORM:case e.RenderbufferFormat.STENCIL_INDEX8:return 1;case e.PixelFormat.LUMINANCE_ALPHA:case e.PixelFormat.RG:case e.PixelFormat.RG_INTEGER:case e.SizedPixelFormat.RGBA4:case e.SizedPixelFormat.R16F:case e.SizedPixelFormat.R16I:case e.SizedPixelFormat.R16UI:case e.SizedPixelFormat.RG8:case e.SizedPixelFormat.RG8I:case e.SizedPixelFormat.RG8UI:case e.SizedPixelFormat.RG8_SNORM:case e.SizedPixelFormat.RGB565:case e.SizedPixelFormat.RGB5_A1:case e.RenderbufferFormat.DEPTH_COMPONENT16:return 2; |
|
case e.PixelFormat.DEPTH_COMPONENT:case e.PixelFormat.RGB:case e.PixelFormat.RGB_INTEGER:case e.SizedPixelFormat.RGB8:case e.SizedPixelFormat.RGB8I:case e.SizedPixelFormat.RGB8UI:case e.SizedPixelFormat.RGB8_SNORM:case e.SizedPixelFormat.SRGB8:case e.RenderbufferFormat.DEPTH_COMPONENT24:return 3;case e.PixelFormat.DEPTH_STENCIL:case e.PixelFormat.DEPTH24_STENCIL8:case e.PixelFormat.RGBA:case e.PixelFormat.RGBA_INTEGER:case e.SizedPixelFormat.RGBA8:case e.SizedPixelFormat.R32F:case e.SizedPixelFormat.R11F_G11F_B10F:case e.SizedPixelFormat.RG16F:case e.SizedPixelFormat.R32I:case e.SizedPixelFormat.R32UI:case e.SizedPixelFormat.RG16I:case e.SizedPixelFormat.RG16UI:case e.SizedPixelFormat.RGBA8I:case e.SizedPixelFormat.RGBA8UI:case e.SizedPixelFormat.RGBA8_SNORM:case e.SizedPixelFormat.SRGB8_ALPHA8:case e.SizedPixelFormat.RGB9_E5:case e.SizedPixelFormat.RGB10_A2UI:case e.SizedPixelFormat.RGB10_A2:case e.RenderbufferFormat.DEPTH_STENCIL:case e.RenderbufferFormat.DEPTH_COMPONENT32F:case e.RenderbufferFormat.DEPTH24_STENCIL8:return 4; |
|
case e.RenderbufferFormat.DEPTH32F_STENCIL8:return 5;case e.SizedPixelFormat.RGB16F:case e.SizedPixelFormat.RGB16I:case e.SizedPixelFormat.RGB16UI:return 6;case e.SizedPixelFormat.RG32F:case e.SizedPixelFormat.RG32I:case e.SizedPixelFormat.RG32UI:case e.SizedPixelFormat.RGBA16F:case e.SizedPixelFormat.RGBA16I:case e.SizedPixelFormat.RGBA16UI:return 8;case e.SizedPixelFormat.RGB32F:case e.SizedPixelFormat.RGB32I:case e.SizedPixelFormat.RGB32UI:return 12;case e.SizedPixelFormat.RGBA32F:case e.SizedPixelFormat.RGBA32I:case e.SizedPixelFormat.RGBA32UI:return 16; |
|
case e.CompressedTextureFormat.COMPRESSED_RGB_S3TC_DXT1_EXT:case e.CompressedTextureFormat.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case e.CompressedTextureFormat.COMPRESSED_RGBA_S3TC_DXT3_EXT:case e.CompressedTextureFormat.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case e.CompressedTextureFormat.COMPRESSED_R11_EAC:case e.CompressedTextureFormat.COMPRESSED_SIGNED_R11_EAC:case e.CompressedTextureFormat.COMPRESSED_RGB8_ETC2:case e.CompressedTextureFormat.COMPRESSED_SRGB8_ETC2:case e.CompressedTextureFormat.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case e.CompressedTextureFormat.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5; |
|
case e.CompressedTextureFormat.COMPRESSED_RG11_EAC:case e.CompressedTextureFormat.COMPRESSED_SIGNED_RG11_EAC:case e.CompressedTextureFormat.COMPRESSED_RGBA8_ETC2_EAC:case e.CompressedTextureFormat.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0};c.getErrorString=z;c.getStride=h;c.unbindVertexBufferLayout=function(m,w,v,d){const k=m.gl;m.bindBuffer(v);for(const q of d)if(v=w.get(q.name),4>=q.count)k.disableVertexAttribArray(v),q.divisor&&0<q.divisor&&m.gl?.vertexAttribDivisor(v,0);else if(9===q.count)for(d= |
|
0;3>d;d++)k.disableVertexAttribArray(v+d),q.divisor&&0<q.divisor&&m.gl?.vertexAttribDivisor(v+d,0);else if(16===q.count)for(d=0;4>d;d++)k.disableVertexAttribArray(v+d),q.divisor&&0<q.divisor&&m.gl?.vertexAttribDivisor(v+d,0);else console.error("Unsupported vertex attribute element count: "+q.count);m.unbindBuffer(e.BufferType.ARRAY_BUFFER)};c.vertexCount=function(m,w){return m.vertexBuffers[w].usedMemory/h(m.layout[w])};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/getDataTypeBytes":function(){define(["exports", |
|
"./enums"],function(c,a){c.getDataTypeBytes=function(y){switch(y){case a.DataType.BYTE:case a.DataType.UNSIGNED_BYTE:return 1;case a.DataType.SHORT:case a.DataType.UNSIGNED_SHORT:case a.DataType.HALF_FLOAT:return 2;case a.DataType.FLOAT:case a.DataType.INT:case a.DataType.UNSIGNED_INT:return 4}};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Texture":function(){define("exports ../../core/Error ../../core/has ./checkWebGLError ./enums ./GLObjectType ./TextureDescriptor ./ValidatedTextureDescriptor".split(" "), |
|
function(c,a,y,e,n,z,h,m){function w(g){(null!=g.width&&0>g.width||null!=g.height&&0>g.height||null!=g.depth&&0>g.depth)&&console.error("Negative dimension parameters are not allowed!")}function v(g,b){let l=b.samplingMode,p=b.samplingMode;if(l===n.TextureSamplingMode.LINEAR_MIPMAP_NEAREST||l===n.TextureSamplingMode.LINEAR_MIPMAP_LINEAR)l=n.TextureSamplingMode.LINEAR,b.hasMipmap||(p=n.TextureSamplingMode.LINEAR);else if(l===n.TextureSamplingMode.NEAREST_MIPMAP_NEAREST||l===n.TextureSamplingMode.NEAREST_MIPMAP_LINEAR)l= |
|
n.TextureSamplingMode.NEAREST,b.hasMipmap||(p=n.TextureSamplingMode.NEAREST);g.texParameteri(b.target,g.TEXTURE_MAG_FILTER,l);g.texParameteri(b.target,g.TEXTURE_MIN_FILTER,p)}function d(g,b){"number"===typeof b.wrapMode?(g.texParameteri(b.target,g.TEXTURE_WRAP_S,b.wrapMode),g.texParameteri(b.target,g.TEXTURE_WRAP_T,b.wrapMode)):(g.texParameteri(b.target,g.TEXTURE_WRAP_S,b.wrapMode.s),g.texParameteri(b.target,g.TEXTURE_WRAP_T,b.wrapMode.t))}function k(g,b){const l=g.capabilities.textureFilterAnisotropic; |
|
l&&g.gl.texParameterf(b.target,l.TEXTURE_MAX_ANISOTROPY,b.maxAnisotropy??1)}function q(g){return null!=g&&"type"in g&&"compressed"===g.type}function A(g){return null!=g&&!q(g)&&!(null!=g&&"byteLength"in g)}function f(g){return g===n.TextureType.TEXTURE_3D||g===n.TextureType.TEXTURE_2D_ARRAY}function x(g,b,l,p=1){b=Math.max(b,l);g===n.TextureType.TEXTURE_3D&&(b=Math.max(b,p));return Math.round(Math.log(b)/Math.LN2)+1}y=class g{constructor(b,l=null,p=null){this.type=z.GLObjectType.Texture;this._glName= |
|
null;this._wasImmutablyAllocated=this._wrapModeDirty=this._samplingModeDirty=!1;if("context"in b)this._descriptor=b,p=l;else{b=m.ValidatedTextureDescriptor.validate(b,l);if(!b)throw new a("Texture descriptor invalid");this._descriptor=b}this._descriptor.target===n.TextureType.TEXTURE_CUBE_MAP?this._setDataCubeMap(p):this.setData(p)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return h.estimateMemory(this._descriptor)}get isDirty(){return this._samplingModeDirty|| |
|
this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(n.ResourceType.Texture,this);this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(b,l){const p=this._descriptor;if(p.width!==b||p.height!==l){if(this._wasImmutablyAllocated)throw new a("Immutable textures can't be resized!");p.width=b;p.height=l;this._descriptor.target=== |
|
n.TextureType.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(b=null){for(let l=n.TextureType.TEXTURE_CUBE_MAP_POSITIVE_X;l<=n.TextureType.TEXTURE_CUBE_MAP_NEGATIVE_Z;l++)this._setData(b,l)}setData(b){this._setData(b)}_setData(b,l){if(this._descriptor.context?.gl){var p=this._descriptor.context.gl;e.checkWebGLError(p);this._glName||(this._glName=p.createTexture())&&this._descriptor.context.instanceCounter.increment(n.ResourceType.Texture,this);void 0===b&&(b=null); |
|
var r=this._descriptor,E=l??r.target,G=f(E);null===b&&(r.width=r.width||4,r.height=r.height||4,G&&(r.depth=r.depth??1));l=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES);w(r);this._configurePixelStorage();e.checkWebGLError(p);var u=this._deriveInternalFormat();if(A(b)){let C="width"in b?b.width:b.codedWidth,D="height"in b?b.height:b.codedHeight;b instanceof HTMLVideoElement&&(C=b.videoWidth,D=b.videoHeight); |
|
r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(E,u,r.hasMipmap,C,D,1);this._texImage(E,0,u,C,D,1,b);e.checkWebGLError(p);r.hasMipmap&&this.generateMipmap();r.width||(r.width=C);r.height||(r.height=D);G&&!r.depth&&(r.depth=1)}else{const {width:C,height:D,depth:t}=r;if(null==C||null==D)throw new a("Width and height must be specified!");if(G&&null==t)throw new a("Depth must be specified!");r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(E,u,r.hasMipmap,C,D,t);if(q(b)){const B= |
|
b.levels;b=x(E,C,D,t);b=Math.min(b-1,B.length-1);p.texParameteri(r.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,b);if(!(u in n.CompressedTextureFormat))throw new a("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((F,I,J,K)=>{this._compressedTexImage(E,F,u,I,J,K,B[Math.min(F,B.length-1)])},b)}else this._texImage(E,0,u,C,D,t,b),e.checkWebGLError(p),r.hasMipmap&&this.generateMipmap()}v(p,this._descriptor);d(p,this._descriptor);k(this._descriptor.context, |
|
this._descriptor);e.checkWebGLError(p);this._descriptor.context.bindTexture(l,g.TEXTURE_UNIT_FOR_UPDATES)}}updateData(b,l,p,r,E,G,u=0){G||console.error("An attempt to use uninitialized data!");this._glName||console.error("An attempt to update uninitialized texture!");var C=this._descriptor;const D=this._deriveInternalFormat(),{context:t,pixelFormat:B,dataType:F,target:I,isImmutable:J}=C;if(J&&!this._wasImmutablyAllocated)throw new a("Cannot update immutable texture before allocation!");const K=t.bindTexture(this, |
|
g.TEXTURE_UNIT_FOR_UPDATES,!0);(0>l||0>p||l+r>C.width||p+E>C.height)&&console.error("An attempt to update out of bounds of the texture!");this._configurePixelStorage();({gl:C}=t);u&&C.pixelStorei(C.UNPACK_SKIP_ROWS,u);A(G)?C.texSubImage2D(I,b,l,p,r,E,B,F,G):q(G)?C.compressedTexSubImage2D(I,b,l,p,r,E,D,G.levels[b]):C.texSubImage2D(I,b,l,p,r,E,B,F,G);u&&C.pixelStorei(C.UNPACK_SKIP_ROWS,0);t.bindTexture(K,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(b,l,p,r,E,G,u,C){C||console.error("An attempt to use uninitialized data!"); |
|
this._glName||console.error("An attempt to update uninitialized texture!");var D=this._descriptor;const t=this._deriveInternalFormat(),{context:B,pixelFormat:F,dataType:I,isImmutable:J,target:K}=D;if(J&&!this._wasImmutablyAllocated)throw new a("Cannot update immutable texture before allocation!");f(K)||console.warn("Attempting to set 3D texture data on a non-3D texture");const L=B.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);B.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES);(0>l||0>p||0>r||l+E>D.width|| |
|
p+G>D.height||r+u>D.depth)&&console.error("An attempt to update out of bounds of the texture!");this._configurePixelStorage();({gl:D}=B);q(C)?(C=C.levels[b],D.compressedTexSubImage3D(K,b,l,p,r,E,G,u,t,C)):D.texSubImage3D(K,b,l,p,r,E,G,u,F,I,C);B.bindTexture(L,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const b=this._descriptor;if(!b.hasMipmap){if(this._wasImmutablyAllocated)throw new a("Cannot add mipmaps to immutable texture after allocation");this._samplingModeDirty=b.hasMipmap=!0;w(b)}b.samplingMode=== |
|
n.TextureSamplingMode.LINEAR?(this._samplingModeDirty=!0,b.samplingMode=n.TextureSamplingMode.LINEAR_MIPMAP_NEAREST):b.samplingMode===n.TextureSamplingMode.NEAREST&&(this._samplingModeDirty=!0,b.samplingMode=n.TextureSamplingMode.NEAREST_MIPMAP_NEAREST);const l=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.gl.generateMipmap(b.target);this._descriptor.context.bindTexture(l,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const b= |
|
this._descriptor;if(b.hasMipmap){if(this._wasImmutablyAllocated)throw new a("Cannot delete mipmaps to immutable texture after allocation");b.hasMipmap=!1;this._samplingModeDirty=!0;w(b)}b.samplingMode===n.TextureSamplingMode.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,b.samplingMode=n.TextureSamplingMode.LINEAR):b.samplingMode===n.TextureSamplingMode.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,b.samplingMode=n.TextureSamplingMode.NEAREST)}setSamplingMode(b){b!==this._descriptor.samplingMode&& |
|
(this._descriptor.samplingMode=b,this._samplingModeDirty=!0)}setWrapMode(b){b!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=b,w(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const b=this._descriptor,l=b.context.gl;this._samplingModeDirty&&(v(l,b),this._samplingModeDirty=!1);this._wrapModeDirty&&(d(l,b),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(null!=this._descriptor.internalFormat)return this._descriptor.internalFormat===n.PixelFormat.DEPTH_STENCIL&&(this._descriptor.internalFormat= |
|
n.PixelFormat.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case n.PixelType.FLOAT:switch(this._descriptor.pixelFormat){case n.PixelFormat.RGBA:return this._descriptor.internalFormat=n.SizedPixelFormat.RGBA32F;case n.PixelFormat.RGB:return this._descriptor.internalFormat=n.SizedPixelFormat.RGB32F;default:throw new a("Unable to derive format");}case n.PixelType.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case n.PixelFormat.RGBA:return this._descriptor.internalFormat= |
|
n.SizedPixelFormat.RGBA8;case n.PixelFormat.RGB:return this._descriptor.internalFormat=n.SizedPixelFormat.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===n.PixelFormat.DEPTH_STENCIL?n.PixelFormat.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const b=this._descriptor.context.gl,{unpackAlignment:l,flipped:p,preMultiplyAlpha:r}=this._descriptor;b.pixelStorei(b.UNPACK_ALIGNMENT,l);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,p?1:0);b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, |
|
r?1:0)}_texStorage(b,l,p,r,E,G){const {gl:u}=this._descriptor.context;if(!(l in n.SizedPixelFormat))throw new a("Immutable textures must have a sized internal format");if(this._descriptor.isImmutable){p=p?x(b,r,E,G):1;if(f(b)){if(null==G)throw new a("Missing depth dimension for 3D texture upload");u.texStorage3D(b,p,l,r,E,G)}else u.texStorage2D(b,p,l,r,E);this._wasImmutablyAllocated=!0}}_texImage(b,l,p,r,E,G,u){const C=this._descriptor.context.gl,D=f(b),{isImmutable:t,pixelFormat:B,dataType:F}=this._descriptor; |
|
if(t){if(null!=u)if(D){if(null==G)throw new a("Missing depth dimension for 3D texture upload");C.texSubImage3D(b,l,0,0,0,r,E,G,B,F,u)}else C.texSubImage2D(b,l,0,0,r,E,B,F,u)}else if(D){if(null==G)throw new a("Missing depth dimension for 3D texture upload");C.texImage3D(b,l,p,r,E,G,0,B,F,u)}else C.texImage2D(b,l,p,r,E,0,B,F,u)}_compressedTexImage(b,l,p,r,E,G,u){const C=this._descriptor.context.gl,D=f(b);if(this._descriptor.isImmutable){if(null!=u)if(D){if(null==G)throw new a("Missing depth dimension for 3D texture upload"); |
|
C.compressedTexSubImage3D(b,l,0,0,0,r,E,G,p,u)}else C.compressedTexSubImage2D(b,l,0,0,r,E,p,u)}else if(D){if(null==G)throw new a("Missing depth dimension for 3D texture upload");C.compressedTexImage3D(b,l,p,r,E,G,0,u)}else C.compressedTexImage2D(b,l,p,r,E,0,u)}_forEachMipmapLevel(b,l=Infinity){let {width:p,height:r,depth:E,hasMipmap:G,target:u}=this._descriptor;const C=u===n.TextureType.TEXTURE_3D;if(null==p||null==r||C&&null==E)throw new a("Missing texture dimensions for mipmap calculation");for(let D= |
|
0;;++D){b(D,p,r,E);if(!G||1===p&&1===r&&(!C||1===E)||D>=l)break;p=Math.max(1,p>>1);r=Math.max(1,r>>1);C&&(E=Math.max(1,E>>1))}}};y.TEXTURE_UNIT_FOR_UPDATES=0;c.Texture=y;c.tracer=null;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/TextureDescriptor":function(){define(["exports","./enums","./Util"],function(c,a,y){class e{constructor(n=0,z=n){this.width=n;this.height=z;this.target=a.TextureType.TEXTURE_2D;this.pixelFormat=a.PixelFormat.RGBA;this.dataType=a.PixelType.UNSIGNED_BYTE; |
|
this.samplingMode=a.TextureSamplingMode.LINEAR;this.wrapMode=a.TextureWrapMode.REPEAT;this.maxAnisotropy=1;this.isOpaque=this.hasMipmap=this.flipped=!1;this.unpackAlignment=4;this.preMultiplyAlpha=!1;this.depth=1;this.isImmutable=!1}}c.TextureDescriptor=e;c.estimateMemory=function(n){return 0>=n.width||0>=n.height?0:Math.round(n.width*n.height*(n.hasMipmap?4/3:1)*(null==n.internalFormat?4:y.getBytesPerElementFormat(n.internalFormat)))};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})}, |
|
"esri/views/webgl/ValidatedTextureDescriptor":function(){define(["exports","./enums","./TextureDescriptor"],function(c,a,y){class e extends y.TextureDescriptor{constructor(n,z){super();this.context=n;Object.assign(this,z);switch(this.internalFormat){case a.SizedPixelFormat.R16F:case a.SizedPixelFormat.R16I:case a.SizedPixelFormat.R16UI:case a.SizedPixelFormat.R32F:case a.SizedPixelFormat.R32I:case a.SizedPixelFormat.R32UI:case a.SizedPixelFormat.R8_SNORM:case a.SizedPixelFormat.R8:case a.SizedPixelFormat.R8I:case a.SizedPixelFormat.R8UI:this.pixelFormat= |
|
a.PixelFormat.RED}}static validate(n,z){return new e(n,z)}}c.ValidatedTextureDescriptor=e;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Program":function(){define(["exports","../../core/has","./checkWebGLError","./enums","./ShaderTranspiler"],function(c,a,y,e,n){function z(d,k,q){d=d.gl;const A=d.createShader(k);d.shaderSource(A,q);d.compileShader(A);y.webglValidateShadersEnabled()&&!d.getShaderParameter(A,d.COMPILE_STATUS)&&(console.error("Compile error in ".concat(k=== |
|
e.ShaderType.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(d.getShaderInfoLog(A)),console.error(h(q)));return A}function h(d){let k=2;return d.replaceAll("\n",()=>{var q=k++;q=1E3<=q?q.toString():(" "+q).slice(-3);return"\n"+q+":"})}function m(d,k,q){const A=d.get(k);if(!A)return d.set(k,Array.from(q)),!0;const f=q.length;if(A.length!==f)return d.set(k,Array.from(q)),!0;for(d=0;d<f;++d)if(k=q[d],A[d]!==k){for(A[d]=k;d<f;++d)A[d]=q[d];return!0}return!1}class w{constructor(d,k,q,A,f= |
|
new Map,x=[]){this._context=d;this._locations=A;this._uniformBlockBindings=f;this._transformFeedbackVaryings=x;this._refCount=1;this._compiled=!1;this._linesOfCode=0;this._nameToUniformLocation=new Map;this._nameToUniform1=new Map;this._nameToUniform1v=new Map;this._nameToUniform2=new Map;this._nameToUniform3=new Map;this._nameToUniform4=new Map;this._nameToUniformMatrix3=new Map;this._nameToUniformMatrix4=new Map;d||console.error("RenderingContext isn't initialized!");0===k.length&&console.error("Shaders source should not be empty!"); |
|
k=n.transpileShader(k,e.ShaderType.VERTEX_SHADER);q=n.transpileShader(q,e.ShaderType.FRAGMENT_SHADER);this._vShader=z(this._context,e.ShaderType.VERTEX_SHADER,k);this._fShader=z(this._context,e.ShaderType.FRAGMENT_SHADER,q);v.enabled&&(this._linesOfCode=k.match(/\n/g).length+q.match(/\n/g).length+2,this._context.instanceCounter.increment(e.ResourceType.LinesOfCode,this._vShader,this._linesOfCode));this._vShader&&this._fShader||console.error("Error loading shaders!");this._context.instanceCounter.increment(e.ResourceType.Shader, |
|
this);y.webglValidateShadersEnabled()&&(this.vertexShader=k,this.fragmentShader=q);this.usedMemory=k.length+q.length;const g=this._context.gl,b=g.createProgram();g.attachShader(b,this._vShader);g.attachShader(b,this._fShader);this._locations.forEach((l,p)=>g.bindAttribLocation(b,l,p));this._transformFeedbackVaryings?.length&&g.transformFeedbackVaryings(b,this._transformFeedbackVaryings,g.SEPARATE_ATTRIBS);g.linkProgram(b);y.webglValidateShadersEnabled()&&!g.getProgramParameter(b,g.LINK_STATUS)&&console.error("Could not link shader\n"+ |
|
`validated: ${g.getProgramParameter(b,g.VALIDATE_STATUS)}`+`, gl error ${g.getError()}`+`, vertex: ${g.getShaderParameter(this._vShader,g.COMPILE_STATUS)}`+`, fragment: ${g.getShaderParameter(this._fShader,g.COMPILE_STATUS)}`+`, info log: ${g.getProgramInfoLog(b)}`+`, vertex source: ${this.vertexShader}`+`, fragment source: ${this.fragmentShader}`);for(const [l,p]of this._uniformBlockBindings)d=g.getUniformBlockIndex(b,l),4294967295>d&&g.uniformBlockBinding(b,d,p);this._glName=b;this._context.instanceCounter.increment(e.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 d=this._context.gl.getExtension("KHR_parallel_shader_compile");return null==d||null==this.glName?this._compiled=!0:this._compiled=!!this._context.gl.getProgramParameter(this.glName,d.COMPLETION_STATUS_KHR)}dispose(){if(!(0<--this._refCount)){var d=this._context.gl,k=this._context.instanceCounter; |
|
this._nameToUniformLocation.forEach(q=>q&&k.decrement(e.ResourceType.Uniform,q));this._nameToUniformLocation.clear();this._vShader&&(0<this._linesOfCode&&(k.decrement(e.ResourceType.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),d.deleteShader(this._vShader),this._vShader=null,k.decrement(e.ResourceType.Shader,this));this._fShader&&(d.deleteShader(this._fShader),this._fShader=null);this._glName&&(d.deleteProgram(this._glName),this._glName=null,k.decrement(e.ResourceType.Program, |
|
this))}}ref(){++this._refCount}_getUniformLocation(d){var k=this._nameToUniformLocation.get(d);return void 0!==k?k:this.glName?(k=this._context.gl.getUniformLocation(this.glName,d),this._nameToUniformLocation.set(d,k),k&&this._context.instanceCounter.increment(e.ResourceType.Uniform,k),k):null}hasUniform(d){return null!=this._getUniformLocation(d)}setUniform1i(d,k){const q=this._nameToUniform1.get(d);if(void 0===q||k!==q)this._context.gl.uniform1i(this._getUniformLocation(d),k),this._nameToUniform1.set(d, |
|
k)}setUniform1iv(d,k){m(this._nameToUniform1v,d,k)&&this._context.gl.uniform1iv(this._getUniformLocation(d),k)}setUniform2iv(d,k){m(this._nameToUniform2,d,k)&&this._context.gl.uniform2iv(this._getUniformLocation(d),k)}setUniform3iv(d,k){m(this._nameToUniform3,d,k)&&this._context.gl.uniform3iv(this._getUniformLocation(d),k)}setUniform4iv(d,k){m(this._nameToUniform4,d,k)&&this._context.gl.uniform4iv(this._getUniformLocation(d),k)}setUniform1f(d,k){const q=this._nameToUniform1.get(d);if(void 0===q|| |
|
k!==q)this._context.gl.uniform1f(this._getUniformLocation(d),k),this._nameToUniform1.set(d,k)}setUniform1fv(d,k){m(this._nameToUniform1v,d,k)&&this._context.gl.uniform1fv(this._getUniformLocation(d),k)}setUniform2f(d,k,q){const A=this._nameToUniform2.get(d);if(void 0===A)this._context.gl.uniform2f(this._getUniformLocation(d),k,q),this._nameToUniform2.set(d,[k,q]);else if(k!==A[0]||q!==A[1])this._context.gl.uniform2f(this._getUniformLocation(d),k,q),A[0]=k,A[1]=q}setUniform2fv(d,k){m(this._nameToUniform2, |
|
d,k)&&this._context.gl.uniform2fv(this._getUniformLocation(d),k)}setUniform3f(d,k,q,A){const f=this._nameToUniform3.get(d);if(void 0===f)this._context.gl.uniform3f(this._getUniformLocation(d),k,q,A),this._nameToUniform3.set(d,[k,q,A]);else if(k!==f[0]||q!==f[1]||A!==f[2])this._context.gl.uniform3f(this._getUniformLocation(d),k,q,A),f[0]=k,f[1]=q,f[2]=A}setUniform3fv(d,k){const q=this._getUniformLocation(d);null!=q&&m(this._nameToUniform3,d,k)&&this._context.gl.uniform3fv(q,k)}setUniform4f(d,k,q,A, |
|
f){const x=this._nameToUniform4.get(d);if(void 0===x)this._context.gl.uniform4f(this._getUniformLocation(d),k,q,A,f),this._nameToUniform4.set(d,[k,q,A,f]);else if(void 0===x||k!==x[0]||q!==x[1]||A!==x[2]||f!==x[3])this._context.gl.uniform4f(this._getUniformLocation(d),k,q,A,f),x[0]=k,x[1]=q,x[2]=A,x[3]=f}setUniform4fv(d,k){const q=this._getUniformLocation(d);null!=q&&m(this._nameToUniform4,d,k)&&this._context.gl.uniform4fv(q,k)}setUniformMatrix3fv(d,k,q=!1){const A=this._getUniformLocation(d);null!= |
|
A&&m(this._nameToUniformMatrix3,d,k)&&this._context.gl.uniformMatrix3fv(A,q,k)}setUniformMatrix4fv(d,k,q=!1){const A=this._getUniformLocation(d);null!=A&&m(this._nameToUniformMatrix4,d,k)&&this._context.gl.uniformMatrix4fv(A,q,k)}stop(){}}const v={enabled:!1};c.Program=w;c.test=v;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/ShaderTranspiler":function(){define("exports ../../core/has ./enums ./reservedWordsGLSL3 ./testUtils ../../chunks/builtins".split(" "),function(c, |
|
a,y,e,n,z){function h(){function g(H){H.length&&I.push({type:A[D],data:H,position:L,line:J,column:K})}function b(){F=F.length?[]:F;if("/"===B&&"*"===t)return L=C+u-1,D=0,B=t,u+1;if("/"===B&&"/"===t)return L=C+u-1,D=1,B=t,u+1;if("#"===t)return D=2,L=C+u,u;if(/\s/.test(t))return D=9,L=C+u,u;P=/\d/.test(t);Q=/[^\w_]/.test(t);L=C+u;D=P?4:Q?3:9999;return u}function l(){if(("\r"===t||"\n"===t)&&"\\"!==B)return g(F.join("")),D=999,u;F.push(t);B=t;return u+1}function p(){if("."===B&&/\d/.test(t))return D= |
|
5,u;if("/"===B&&"*"===t)return D=0,u;if("/"===B&&"/"===t)return D=1,u;if("."===t&&F.length){for(;r(F););D=5;return u}if(";"===t||")"===t||"("===t){if(F.length)for(;r(F););g(t);D=999;return u+1}var H=2===F.length&&"\x3d"!==t;if(/[\w_\d\s]/.test(t)||H){for(;r(F););D=999;return u}F.push(t);B=t;return u+1}function r(H){var N=0;do{var R=z.operators.indexOf(H.slice(0,H.length+N).join(""));var O=z.operators[R];if(-1===R){if(0<N--+H.length)continue;O=H.slice(0,1).join("")}g(O);L+=O.length;F=F.slice(O.length); |
|
return F.length}while(1)}function E(){if("."===t||/[eE]/.test(t))return F.push(t),D=5,B=t,u+1;if("x"===t&&1===F.length&&"0"===F[0])return D=11,F.push(t),B=t,u+1;if(/[^\d]/.test(t))return g(F.join("")),D=999,u;F.push(t);B=t;return u+1}function G(){"f"===t&&(F.push(t),B=t,u+=1);if(/[eE]/.test(t)||"-"===t&&/[eE]/.test(B))return F.push(t),B=t,u+1;if(/[^\d]/.test(t))return g(F.join("")),D=999,u;F.push(t);B=t;return u+1}var u=0,C=0,D=999,t,B,F=[],I=[],J=1,K=0,L=0,P=!1,Q=!1,M="",S;return function(H){I=[]; |
|
if(null!==H){H=H.replace?H.replace(/\r\n/g,"\n"):H;u=0;M+=H;for(S=M.length;t=M[u],u<S;){H=u;switch(D){case 0:"/"===t&&"*"===B?(F.push(t),g(F.join("")),D=999):(F.push(t),B=t);u+=1;break;case 1:u=l();break;case 2:u=l();break;case 3:u=p();break;case 4:u=E();break;case 11:/[^a-fA-F0-9]/.test(t)?(g(F.join("")),D=999):(F.push(t),B=t,u+=1);break;case 5:u=G();break;case 9999:if(/[^\d\w_]/.test(t)){var N=F.join("");D=-1<z.literals.indexOf(N)?8:-1<z.builtins.indexOf(N)?7:6;g(F.join(""));D=999}else F.push(t), |
|
B=t,u+=1;break;case 9:/[^\s]/g.test(t)?(g(F.join("")),D=999):(F.push(t),B=t,u+=1);break;case 999:u=b()}if(H!==u)switch(M[H]){case "\n":K=0;++J;break;default:++K}}C+=u;M=M.slice(u);return I}F.length&&g(F.join(""));D=10;g("(eof)");return I}}function m(g){return g.map(b=>"eof"!==b.type?b.data:"").join("")}function w(g,b="100",l="300 es"){const p=/^\s*#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const r of g)if("preprocessor"===r.type){const E=p.exec(r.data);if(E){g=E[1].replaceAll(/\s{2,}/g," ");if(g=== |
|
l)return g;if(g===b)return r.data="#version "+l,b;throw Error("unknown glsl version: "+g);}}g.splice(0,0,{type:"preprocessor",data:"#version "+l},{type:"whitespace",data:"\n"});return null}function v(g,b,l,p){p=p||l;for(const r of g)if("ident"===r.type&&r.data===l)return p in b?b[p]++:b[p]=0,v(g,b,p+"_"+b[p],p);return l}function d(g,b,l="afterVersion"){const p={data:"\n",type:"whitespace"},r=G=>G<g.length?/[^\r\n]$/.test(g[G].data):!1;let E=function(G){let u=-1,C=0,D=-1;for(let B=0;B<G.length;B++){var t= |
|
G[B];"preprocessor"===t.type&&(/#(if|ifdef|ifndef)\s+.+/.test(t.data)?++C:/#endif\s*.*/.test(t.data)&&--C);("afterVersion"===l||"afterPrecision"===l)&&"preprocessor"===t.type&&t.data.startsWith("#version")&&(D=Math.max(D,B));if("afterPrecision"===l&&"keyword"===t.type&&"precision"===t.data){a:{for(t=B;t<G.length;t++){const F=G[t];if("operator"===F.type&&";"===F.data)break a}t=null}if(null===t)throw Error("precision statement not followed by any semicolons!");D=Math.max(D,t)}u<D&&0===C&&(u=B)}return u+ |
|
1}(g);r(E-1)&&g.splice(E++,0,p);for(const G of b)g.splice(E++,0,G);r(E-1)&&r(E)&&g.splice(E,0,p)}function k(g,b,l,p="lowp"){d(g,[{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:p},{type:"whitespace",data:" "},{type:"keyword",data:l},{type:"whitespace",data:" "},{type:"ident",data:b},{type:"operator",data:";"}],"afterPrecision")}function q(g,b,l,p,r="lowp"){d(g,[{type:"keyword",data:"layout"},{type:"operator",data:"("},{type:"keyword",data:"location"},{type:"whitespace", |
|
data:" "},{type:"operator",data:"\x3d"},{type:"whitespace",data:" "},{type:"integer",data:p.toString()},{type:"operator",data:")"},{type:"whitespace",data:" "},{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:r},{type:"whitespace",data:" "},{type:"keyword",data:l},{type:"whitespace",data:" "},{type:"ident",data:b},{type:"operator",data:";"}],"afterPrecision")}var A="block-comment line-comment preprocessor operator integer float ident builtin keyword whitespace eof integer".split(" "); |
|
const f=new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),x=new Map;c.transpileShader=function(g,b){if(g.startsWith("#version 300"))return g;var l=n.shaderTranspiler.enableCache?x.get(g):null;if(null!=l)return l;l=h();var p=[];p=p.concat(l(g));l=p=p.concat(l(null));if("300 es"===w(l,"100","300 es"))return g;var r=p=null;const E={},G={};for(let t=0;t<l.length;++t){const B=l[t];switch(B.type){case "keyword":b===y.ShaderType.VERTEX_SHADER&& |
|
"attribute"===B.data?B.data="in":"varying"===B.data&&(B.data=b===y.ShaderType.VERTEX_SHADER?"out":"in");break;case "builtin":/^texture(2D|Cube)(Proj)?(Lod|Grad)?(EXT)?$/.test(B.data.trim())&&(B.data=B.data.replaceAll(/(2D|Cube|EXT)/g,""));b===y.ShaderType.FRAGMENT_SHADER&&"gl_FragColor"===B.data&&(p||(p=v(l,E,"fragColor"),k(l,p,"vec4")),B.data=p);if(b===y.ShaderType.FRAGMENT_SHADER&&"gl_FragData"===B.data){var u=void 0;let F=void 0;var C=l,D=t+1;let I=-1;for(;D<C.length;D++){const J=C[D];if("operator"=== |
|
J.type&&("["===J.data&&(F=D),"]"===J.data)){u=D;break}"integer"===J.type&&(I=parseInt(J.data,10))}F&&u&&C.splice(F,u-F+1);C=I;u=v(l,E,"fragData");q(l,u,"vec4",C,"mediump");B.data=u}else b===y.ShaderType.FRAGMENT_SHADER&&"gl_FragDepthEXT"===B.data&&(r||=v(l,E,"gl_FragDepth"),B.data=r);break;case "ident":if(e.includes(B.data)){if(C=b===y.ShaderType.VERTEX_SHADER)a:{for(C=t-1;0<=C;C--)if(u=l[C],"whitespace"!==u.type&&"block-comment"!==u.type)if("keyword"===u.type){if("attribute"===u.data||"in"===u.data){C= |
|
!0;break a}}else break;C=!1}if(C)throw Error("attribute in vertex shader uses a name that is a reserved word in glsl 300 es");B.data in G||(G[B.data]=v(l,E,B.data));B.data=G[B.data]}}}for(b=l.length-1;0<=b;--b)p=l[b],"preprocessor"===p.type&&(r=p.data.match(/#extension\s+(.*):/),r?.[1]&&f.has(r[1].trim())&&(r=l[b+1],l.splice(b,r&&"whitespace"===r.type?2:1)),r=p.data.match(/#ifdef\s+(.*)/),r?.[1]&&f.has(r[1].trim())&&(p.data="#if 1"),r=p.data.match(/#ifndef\s+(.*)/),r?.[1]&&f.has(r[1].trim())&&(p.data= |
|
"#if 0"));l=m(l);n.shaderTranspiler.enableCache&&x.set(g,l);return l};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/reservedWordsGLSL3":function(){define(function(){return"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".split(" ")})}, |
|
"esri/views/webgl/testUtils":function(){define(["exports"],function(c){c.shaderTranspiler={enableCache:!1};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/builtins":function(){define(["exports","./_commonjsHelpers"],function(c,a){var y={exports:{}};(function(z){(function(h){h=h();void 0!==h&&(z.exports=h)})(function(){return"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".split(" ")})})(y); |
|
y=a.getDefaultExportFromCjs(y.exports);var e={exports:{}};(function(z){(function(h){h=h();void 0!==h&&(z.exports=h)})(function(){return"\x3c\x3c\x3d \x3e\x3e\x3d ++ -- \x3c\x3c \x3e\x3e \x3c\x3d \x3e\x3d \x3d\x3d !\x3d \x26\x26 || +\x3d -\x3d *\x3d /\x3d %\x3d \x26\x3d ^^ ^\x3d |\x3d ( ) [ ] . ! ~ * / % + - \x3c \x3e \x26 ^ | ? : \x3d , ; { }".split(" ")})})(e);e=a.getDefaultExportFromCjs(e.exports);var n={exports:{}};(function(z){(function(h){h=h();void 0!==h&&(z.exports=h)})(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 textureSize texelFetch".split(" ")})})(n); |
|
a=a.getDefaultExportFromCjs(n.exports);c.builtins=a;c.literals=y;c.operators=e})},"esri/views/webgl/ProgramCache":function(){define(["exports","../../core/has","../../core/NestedMap","./Program"],function(c,a,y,e){class n{constructor(z){this._rctx=z;this._store=new y.NestedMap}dispose(){this._store.forEach(z=>z.forEach(h=>h.dispose()));this._store.clear()}acquire(z,h,m,w){const v=this._store.get(z,h);if(null!=v)return v.ref(),v;m=new e.Program(this._rctx,z,h,m,w);m.ref();this._store.set(z,h,m);return m}get test(){}} |
|
c.ProgramCache=n;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/core/NestedMap":function(){define(["exports"],function(c){class a{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(y,e){return this._outer.get(y)?.get(e)}set(y,e,n){const z=this._outer.get(y);z?z.set(e,n):this._outer.set(y,new Map([[e,n]]))}delete(y,e){const n=this._outer.get(y);n&&(n.delete(e),0===n.size&&this._outer.delete(y))}forEach(y){this._outer.forEach((e, |
|
n)=>y(e,n))}}c.NestedMap=a;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/ShaderCompiler":function(){define(["exports"],function(c){class a{constructor(y){this._readFile=y}resolveIncludes(y){return this._resolve(y)}_resolve(y,e=new Map){if(e.has(y))return e.get(y);const n=this._read(y);if(!n)throw Error(`cannot find shader file ${y}`);const z=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let h=z.exec(n);const m=[];for(;null!=h;)m.push({path:h[1],start:h.index,length:h[0].length}), |
|
h=z.exec(n);let w=0,v="";m.forEach(d=>{v+=n.slice(w,d.start);v+=e.has(d.path)?"":this._resolve(d.path,e);w=d.start+d.length});v+=n.slice(w);e.set(y,v);return v}_read(y){return this._readFile(y)}}c.ShaderCompiler=a;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/VertexArrayObject":function(){define("exports ../../core/Logger ../../core/maybe ../../core/typedArrayUtil ./enums ./Util".split(" "),function(c,a,y,e,n,z){const h=()=>a.getLogger("esri.views.webgl.VertexArrayObject"); |
|
c.VertexArrayObject=class{constructor(m,w,v,d,k=null){this._context=m;this._locations=w;this._layout=v;this._buffers=d;this._indexBuffer=k;this._glName=null;this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Object.keys(this._buffers).reduce((m,w)=>m+this._buffers[w].usedMemory,null!=this._indexBuffer?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+ |
|
(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*e.typedArrayStaticSize}dispose(){if(this._context){this._context.getBoundVAO()===this&&this._context.bindVAO(null);for(const m in this._buffers)this._buffers[m]?.dispose(),delete this._buffers[m];this._indexBuffer=y.disposeMaybe(this._indexBuffer);this.disposeVAOOnly()}else(this._glName||0<Object.getOwnPropertyNames(this._buffers).length)&&h().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName), |
|
this._glName=null,this._context.instanceCounter.decrement(n.ResourceType.VertexArrayObject,this));this._context=null}initialize(){if(!this._initialized){var {gl:m}=this._context,w=m.createVertexArray();m.bindVertexArray(w);this._bindLayout();m.bindVertexArray(null);this._glName=w;this._context.instanceCounter.increment(n.ResourceType.VertexArrayObject,this);this._initialized=!0}}bind(){this.initialize();this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const {_buffers:m,_layout:w,_indexBuffer:v}= |
|
this;m||h().error("Vertex buffer dictionary is empty!");const d=this._context.gl;for(const k in m){const q=m[k];q||h().error("Vertex buffer is uninitialized!");const A=w[k];A||h().error("Vertex element descriptor is empty!");z.bindVertexBufferLayout(this._context,this._locations,q,A)}null!=v&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,v.glName)}unbind(){this.initialize();this._context.gl.bindVertexArray(null)}};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/programUtils":function(){define(["exports"], |
|
function(c){c.glslifyDefineMap=function(a){let y="";for(const n in a){var e=a[n];if("boolean"===typeof e)e&&(y+=`#define ${n}\n`);else if("number"===typeof e)y+=`#define ${n} ${e.toFixed()}\n`;else if("object"===typeof e){const {options:z,value:h}=e;if("number"===typeof z[h]){const {value:m,options:w,namespace:v}=e;e=v?`${v}_`:"";for(const d in w)y+=`#define ${e}${d} ${w[d].toFixed()}\n`;y+=`#define ${n} ${e}${m}\n`}else{const m=e.options;let w=0;for(const v in m)y+=`#define ${m[v]} ${(w++).toFixed()}\n`; |
|
y+=`#define ${n} ${m[e.value]}\n`}}}return y};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/ProgramTemplate":function(){define(["exports","./Program"],function(c,a){c.createProgram=function(y,e,n=""){return new a.Program(y,n+e.shaders.vertexShader,n+e.shaders.fragmentShader,e.attributes)};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/contextUtils":function(){define(["exports"],function(c){c.createContext=function(a,y={}){return(a= |
|
a.getContext("webgl2",y))?a:null};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"*noref":1}}); |
|
define("exports ../webgl/BufferObject ../webgl/FramebufferObject ../webgl/Program ../webgl/ProgramCache ../webgl/Renderbuffer ../webgl/ShaderCompiler ../webgl/Texture ../webgl/VertexArrayObject ../webgl/programUtils ../webgl/ProgramTemplate ../webgl/contextUtils".split(" "),function(c,a,y,e,n,z,h,m,w,v,d,k){c.BufferObject=a.BufferObject;c.FramebufferObject=y.FramebufferObject;c.Program=e.Program;c.ProgramCache=n.ProgramCache;c.Renderbuffer=z.Renderbuffer;c.ShaderCompiler=h.ShaderCompiler;c.Texture= |
|
m.Texture;c.VertexArrayObject=w.VertexArrayObject;c.glslifyDefineMap=v.glslifyDefineMap;c.createProgram=d.createProgram;c.createContext=k.createContext;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}); |