{"version":3,"sources":["webpack:///./node_modules/@arcgis/core/views/webgl/BufferObject.js","webpack:///./node_modules/@arcgis/core/views/webgl/VertexArrayObject.js","webpack:///./node_modules/@arcgis/core/views/webgl/FramebufferObject.js","webpack:///./node_modules/@arcgis/core/views/webgl/Renderbuffer.js","webpack:///./node_modules/@arcgis/core/views/webgl/Util.js"],"names":["c","t","getLogger","E","constructor","e","r","i","this","_context","bufferType","usage","_glName","_size","_indexType","instanceCounter","increment","f","BufferObject","gl","createBuffer","o","setData","u","ELEMENT_ARRAY_BUFFER","ARRAY_BUFFER","type","a","WEBGL2","Error","UNIFORM_BUFFER","_","STREAM_READ","PIXEL_PACK_BUFFER","setSize","STREAM_DRAW","PIXEL_UNPACK_BUFFER","h","UNSIGNED_INT","dispose","deleteBuffer","decrement","warn","error","UNSIGNED_SHORT","_setBufferData","byteLength","s","n","getBoundVAO","_isVAOAware","bindVAO","bindBuffer","bufferData","setSubData","bufferSubData","BYTES_PER_ELEMENT","length","subarray","getSubData","b","byteSize","COPY_READ_BUFFER","getBufferSubData","unbindBuffer","clientWaitAsync","_locations","_layout","_buffers","_indexBuffer","_initialized","VertexArrayObject","Object","keys","reduce","size","capabilities","vao","deleteVertexArray","getOwnPropertyNames","initialize","createVertexArray","bindVertexArray","_bindLayout","bind","glName","unbind","_unbindLayout","x","_depthAttachment","_stencilAttachment","_colorAttachments","Map","_depthStencilTexture","_desc","FramebufferObject","Array","isArray","COLOR_ATTACHMENT0","C","descriptor","set","N","U","D","g","H","_validateColorAttachmentPoint","depthTexture","console","depthStencilTarget","DEPTH_STENCIL_RENDER_BUFFER","STENCIL_RENDER_BUFFER","DEPTH_RENDER_BUFFER","getBoundFramebufferObject","_disposeColorAttachments","_disposeDepthStencilAttachments","deleteFramebuffer","bindFramebuffer","get","width","height","F","depthStencilAttachment","getColorTexture","attachColorTexture","_framebufferTexture2D","detachColorTexture","delete","setColorTextureTarget","attachDepthStencilTexture","pixelFormat","DEPTH_STENCIL","dataType","UNSIGNED_INT_24_8","DEPTH_STENCIL_TEXTURE","l","detachDepthStencilTexture","attachDepthStencilBuffer","internalFormat","T","DEPTH_COMPONENT16","DEPTH_ATTACHMENT","DEPTH_STENCIL_ATTACHMENT","framebufferRenderbuffer","FRAMEBUFFER","RENDERBUFFER","detachDepthStencilBuffer","detachAll","forEach","_detachColorAttachment","copyToTexture","target","d","TEXTURE_2D","bindTexture","TEXTURE_UNIT_FOR_UPDATES","setActiveTexture","copyTexSubImage2D","readPixels","createPixelPack","getSubDataAsync","resize","initializeAndBind","createFramebuffer","colorTarget","m","RENDER_BUFFER","TEXTURE","CUBEMAP","RGBA","UNSIGNED_BYTE","samplingMode","p","NEAREST","wrapMode","R","CLAMP_TO_EDGE","S","TEXTURE_CUBE_MAP","A","RGBA4","P","NONE","STENCIL_INDEX8","STENCIL_ATTACHMENT","checkFramebufferStatus","FRAMEBUFFER_COMPLETE","framebufferTexture2D","clear","_MAX_COLOR_ATTACHMENTS","drawBuffers","getParameter","MAX_COLOR_ATTACHMENTS","TEXTURE_CUBE_MAP_POSITIVE_X","Renderbuffer","createRenderbuffer","bindRenderbuffer","multisampled","renderbufferStorageMultisample","samples","renderbufferStorage","parameters","maxSamples","Math","min","deleteRenderbuffer","getError","NO_ERROR","INVALID_ENUM","INVALID_VALUE","INVALID_OPERATION","INVALID_FRAMEBUFFER_OPERATION","OUT_OF_MEMORY","CONTEXT_LOST_WEBGL","vertexBuffers","stride","layout","instancing","name","count","vertexAttribPointer","normalized","offset","enableVertexAttribArray","divisor","vertexAttribDivisor","disableVertexAttribArray","ALPHA","LUMINANCE","RED","RED_INTEGER","R8","R8I","R8UI","R8_SNORM","LUMINANCE_ALPHA","RG","RG_INTEGER","R16F","R16I","R16UI","RG8","RG8I","RG8UI","RG8_SNORM","RGB565","RGB5_A1","DEPTH_COMPONENT","RGB","RGB_INTEGER","RGB8","RGB8I","RGB8UI","RGB8_SNORM","SRGB8","DEPTH_COMPONENT24","RGBA_INTEGER","RGBA8","R32F","R11F_G11F_B10F","RG16F","R32I","R32UI","RG16I","RG16UI","RGBA8I","RGBA8UI","RGBA8_SNORM","SRGB8_ALPHA8","RGB9_E5","RGB10_A2UI","RGB10_A2","DEPTH_COMPONENT32F","DEPTH24_STENCIL8","DEPTH32F_STENCIL8","RGB16F","RGB16I","RGB16UI","RG32F","RG32I","RG32UI","RGBA16F","RGBA16I","RGBA16UI","RGB32F","RGB32I","RGB32UI","RGBA32F","RGBA32I","RGBA32UI","COMPRESSED_RGB_S3TC_DXT1_EXT","COMPRESSED_RGBA_S3TC_DXT1_EXT","COMPRESSED_RGBA_S3TC_DXT3_EXT","COMPRESSED_RGBA_S3TC_DXT5_EXT","COMPRESSED_R11_EAC","COMPRESSED_SIGNED_R11_EAC","COMPRESSED_RGB8_ETC2","COMPRESSED_SRGB8_ETC2","COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2","COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2","COMPRESSED_RG11_EAC","COMPRESSED_SIGNED_RG11_EAC","COMPRESSED_RGBA8_ETC2_EAC","COMPRESSED_SRGB8_ALPHA8_ETC2_EAC","hasMipmap"],"mappings":"0FAAA,6FAIob,MAAMA,EAAEC,IAAEC,UAAU,iCAA2D,MAAMC,EAAEC,YAAYC,EAAEJ,EAAEK,EAAEC,GAAGC,KAAKC,SAASJ,EAAEG,KAAKE,WAAWT,EAAEO,KAAKG,MAAML,EAAEE,KAAKI,QAAQ,KAAKJ,KAAKK,OAAO,EAAEL,KAAKM,gBAAW,EAAOT,EAAEU,gBAAgBC,UAAUC,IAAEC,aAAaV,MAAMA,KAAKI,QAAQJ,KAAKC,SAASU,GAAGC,eAAeC,YAAEb,KAAKC,SAASU,IAAIZ,GAAGC,KAAKc,QAAQf,GAAqB,mBAACF,EAAEJ,EAAEK,GAAG,OAAO,IAAIH,EAAEE,EAAEkB,IAAEC,qBAAqBvB,EAAEK,GAAsB,oBAACD,EAAEJ,EAAEK,GAAG,OAAO,IAAI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yright.txt for details.\n*/\nimport{isArrayLike as e}from\"../../core/arrayUtils.js\";import t from\"../../core/Logger.js\";import{nullifyNonNullableForDispose as r,isSome as i}from\"../../core/maybe.js\";import{isUint16Array as s,isUint32Array as n}from\"../../core/typedArrayUtil.js\";import{checkWebGLError as o}from\"./checkWebGLError.js\";import{ContextType as a}from\"./context-util.js\";import{ResourceType as f,BufferType as u,Usage as _,DataType as h}from\"./enums.js\";const c=t.getLogger(\"esri.views.webgl.BufferObject\");function b(t){return e(t)}class E{constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(f.BufferObject,this),this._glName=this._context.gl.createBuffer(),o(this._context.gl),i&&this.setData(i)}static createIndex(e,t,r){return new E(e,u.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new E(e,u.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==a.WEBGL2)throw new Error(\"Uniform buffers are supported in WebGL2 only!\");return new E(e,u.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=_.STREAM_READ,r){if(e.type!==a.WEBGL2)throw new Error(\"Pixel pack buffers are supported in WebGL2 only!\");const i=new E(e,u.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=_.STREAM_DRAW,r){if(e.type!==a.WEBGL2)throw new Error(\"Pixel unpack buffers are supported in WebGL2 only!\");return new E(e,u.PIXEL_UNPACK_BUFFER,t,r)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===u.ELEMENT_ARRAY_BUFFER?this._indexType===h.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===u.ELEMENT_ARRAY_BUFFER||this.bufferType===u.ARRAY_BUFFER}dispose(){if(this._context?.gl){if(this._glName){this._context.gl.deleteBuffer(this._glName),this._glName=null}this._context.instanceCounter.decrement(f.BufferObject,this),this._context=r(this._context)}else this._glName&&c.warn(\"Leaked WebGL buffer object\")}setSize(e,t=null){if(e<=0&&c.error(\"Buffer size needs to be positive!\"),this.bufferType===u.ELEMENT_ARRAY_BUFFER&&i(t))switch(this._indexType=t,t){case h.UNSIGNED_SHORT:e*=2;break;case h.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===u.ELEMENT_ARRAY_BUFFER&&(s(e)&&(t/=2,this._indexType=h.UNSIGNED_SHORT),n(e)&&(t/=4,this._indexType=h.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const s=this._context.gl;i(t)?s.bufferData(this.bufferType,t,this.usage):s.bufferData(this.bufferType,e,this.usage),o(s),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t>=this._size)&&c.error(\"offset is out of range!\"),r>=i&&c.error(\"end must be bigger than start!\"),t+(i-r)>this._size&&c.error(\"An attempt to write beyond the end of the buffer!\");const s=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===a.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const s=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,s)}o(n),this._isVAOAware&&this._context.bindVAO(s)}getSubData(e,t=0,r,i){if(this._context.type!==a.WEBGL2)return void c.error(\"Get buffer subdata is supported in WebGL2 only!\");if(r<0||i<0)return void c.error(\"Problem getting subdata: offset and length were less than zero!\");const s=b(e)?e.BYTES_PER_ELEMENT:1;if(s*((r??0)+(i??0))>e.byteLength)return void c.error(\"Problem getting subdata: offset and length exceeded destination size!\");t+s*(i??0)>this.byteSize&&c.warn(\"Potential problem getting subdata: requested data exceeds buffer size!\");const n=this._context.gl;this._context.bindBuffer(this,u.COPY_READ_BUFFER),n.getBufferSubData(u.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(u.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===a.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):c.error(\"Get buffer subdata is supported in WebGL2 only!\")}}export{E as BufferObject};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.25/esri/copyright.txt for details.\n*/\nimport t from\"../../core/Logger.js\";import{isSome as e,disposeMaybe as i,nullifyNonNullableForDispose as r}from\"../../core/maybe.js\";import{ResourceType as s}from\"./enums.js\";import{bindVertexBufferLayout as n,unbindVertexBufferLayout as o}from\"./Util.js\";const f=t.getLogger(\"esri.views.webgl.VertexArrayObject\");class a{constructor(t,e,i,r,n=null){this._context=t,this._locations=e,this._layout=i,this._buffers=r,this._indexBuffer=n,this._glName=null,this._initialized=!1,t.instanceCounter.increment(s.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((t,e)=>t+this._buffers[e].size),e(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(t=!0){if(!this._context)return void((this._glName||t&&Object.getOwnPropertyNames(this._buffers).length>0)&&f.warn(\"Leaked WebGL VAO\"));if(this._glName){const t=this._context?.capabilities?.vao;t?(t.deleteVertexArray(this._glName),this._glName=null):f.warn(\"Leaked WebGL VAO\")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),t){for(const t in this._buffers)this._buffers[t]?.dispose(),delete this._buffers[t];this._indexBuffer=i(this._indexBuffer)}this._context.instanceCounter.decrement(s.VertexArrayObject,this),this._context=r(this._context)}initialize(){if(this._initialized)return;const t=this._context.capabilities.vao;if(t){const e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e}this._initialized=!0}bind(){this.initialize();const t=this._context.capabilities.vao;t?t.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:t,_layout:i,_indexBuffer:r}=this;t||f.error(\"Vertex buffer dictionary is empty!\");const s=this._context.gl;for(const e in t){const r=t[e];r||f.error(\"Vertex buffer is uninitialized!\");const s=i[e];s||f.error(\"Vertex element descriptor is empty!\"),n(this._context,this._locations,r,s)}if(e(r)){!!this._context.capabilities.vao?s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r)}}unbind(){this.initialize();const t=this._context.capabilities.vao;t?t.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:t,_layout:i}=this;t||f.error(\"Vertex buffer dictionary is empty!\");for(const e in t){const r=t[e];r||f.error(\"Vertex buffer is uninitialized!\");const s=i[e];o(this._context,this._locations,r,s)}e(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}export{a as VertexArrayObject};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.25/esri/copyright.txt for details.\n*/\nimport t from\"../../core/Logger.js\";import{isSome as e,isNone as i}from\"../../core/maybe.js\";import{BufferObject as r}from\"./BufferObject.js\";import{webglDebugEnabled as h}from\"./checkWebGLError.js\";import{ContextType as s}from\"./context-util.js\";import{ResourceType as n,ColorAttachment as c,DepthStencilTargetType as o,PixelFormat as _,PixelType as a,DepthStencilAttachment as l,RenderbufferFormat as T,FramebufferTarget as E,TextureType as d,Usage as u,BufferType as f,TargetType as m,SizedPixelFormat as A,TextureSamplingMode as p,TextureWrapMode as R}from\"./enums.js\";import{Renderbuffer as g}from\"./Renderbuffer.js\";import{Texture as N}from\"./Texture.js\";import{getGpuMemoryUsage as F}from\"./Util.js\";class x{constructor(t,i,r=null,h=null){if(this._context=t,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._depthStencilTexture=null,this._initialized=!1,this._desc={...i},t.instanceCounter.increment(n.FramebufferObject,this),e(r)){Array.isArray(r)||(r=[r]);for(let t=0;tt+F(i)),0)+F(this.depthStencilAttachment)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&b(e)?e:null}attachColorTexture(t,e=c.COLOR_ATTACHMENT0){if(!t)return;this._validateColorAttachmentPoint(e);U(t.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=c.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(b(e)){const i=e;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t)),this._colorAttachments.delete(t),i}}setColorTextureTarget(t,e=c.COLOR_ATTACHMENT0){const i=this._colorAttachments.get(e);b(i)&&this._framebufferTexture2D(i.glName,e,t)}attachDepthStencilTexture(t){if(i(t))return;const e=t.descriptor;e.pixelFormat!==_.DEPTH_STENCIL&&console.error(\"Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!\"),e.dataType!==a.UNSIGNED_INT_24_8&&console.error(\"Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!\"),this._context.capabilities.depthTexture||console.error(\"Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!\"),U(e,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==o.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=o.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,l)),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,l)),this._depthStencilTexture=null,t}attachDepthStencilBuffer(t){if(i(t))return;const e=t.descriptor;if(e.internalFormat!==T.DEPTH_STENCIL&&e.internalFormat!==T.DEPTH_COMPONENT16&&console.error(\"Depth/Stencil buffer must have correct internalFormat\"),H(e,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=e.internalFormat===T.DEPTH_STENCIL?o.DEPTH_STENCIL_RENDER_BUFFER:o.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const e=this._context.gl,i=this._desc.depthStencilTarget===o.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(E.FRAMEBUFFER,i,e.RENDERBUFFER,t.glName)}this._depthAttachment=t}detachDepthStencilBuffer(){const t=this._context.gl,e=this._depthAttachment;if(e&&this._initialized){this._context.bindFramebuffer(this);const e=this._desc.depthStencilTarget===o.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(E.FRAMEBUFFER,e,t.RENDERBUFFER,null)}return this._depthAttachment=null,e}detachAll(){this._colorAttachments.forEach(((t,e)=>this._detachColorAttachment(e))),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(t,e,i,r,h,s,n){(t<0||e<0||h<0||s<0)&&console.error(\"Offsets cannot be negative!\"),(i<=0||r<=0)&&console.error(\"Copy width and height must be greater than zero!\");const c=this._desc,o=n.descriptor;n.descriptor.target!==d.TEXTURE_2D&&console.error(\"Texture target must be TEXTURE_2D!\"),(null==c?.width||null==c?.height||null==o?.width||null==o?.height||t+i>c.width||e+r>c.height||h+i>o.width||s+r>o.height)&&console.error(\"Bad dimensions, the current input values will attempt to read or copy out of bounds!\");const _=this._context,a=_.bindTexture(n,N.TEXTURE_UNIT_FOR_UPDATES);_.setActiveTexture(N.TEXTURE_UNIT_FOR_UPDATES),_.bindFramebuffer(this),_.gl.copyTexSubImage2D(d.TEXTURE_2D,0,h,s,t,e,i,r),_.bindTexture(a,N.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,h,s,n){(i<=0||r<=0)&&console.error(\"Copy width and height must be greater than zero!\"),n||console.error(\"Target memory is not initialized!\"),this._context.bindFramebuffer(this);this._context.gl.readPixels(t,e,i,r,h,s,n)}async readPixelsAsync(t,e,i,n,c,o,_){if(this._context.type!==s.WEBGL2)return h()&&console.warn(\"Attempting to read pixels using pixel buffer object without WebGL2\"),void this.readPixels(t,e,i,n,c,o,_);const a=this._context.gl,l=r.createPixelPack(this._context,u.STREAM_READ,_.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),a.readPixels(t,e,i,n,c,o,0),this._context.unbindBuffer(f.PIXEL_PACK_BUFFER),await l.getSubDataAsync(_),l.dispose()}resize(t,e){const i=this._desc;if(i.width!==t||i.height!==e){if(!this._initialized)return i.width=t,i.height=e,this._colorAttachments.forEach((i=>{i&&i.resize(t,e)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(t,e));i.width=t,i.height=e,this._colorAttachments.forEach((i=>{i&&i.resize(t,e)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(t,e):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(t,e),this._stencilAttachment&&this._stencilAttachment.resize(t,e)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(t=E.FRAMEBUFFER){const e=this._context.gl;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const i=this._context,r=e.createFramebuffer(),s=this._desc,n=s.colorTarget??m.RENDER_BUFFER,l=s.width??1,u=s.height??1;if(e.bindFramebuffer(t,r),0===this._colorAttachments.size)if(n===m.TEXTURE||n===m.CUBEMAP)this._colorAttachments.set(c.COLOR_ATTACHMENT0,S(i,s,this.descriptor.colorTarget===m.CUBEMAP?d.TEXTURE_CUBE_MAP:d.TEXTURE_2D));else{const t=new g(i,{internalFormat:A.RGBA4,width:l,height:u});this._colorAttachments.set(c.COLOR_ATTACHMENT0,t)}this._colorAttachments.forEach(((i,r)=>{i&&(b(i)?this._framebufferTexture2D(i.glName,r,P(i),t):e.framebufferRenderbuffer(t,r,e.RENDERBUFFER,i.glName))}));const f=s.depthStencilTarget??o.NONE;switch(f){case o.DEPTH_RENDER_BUFFER:case o.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new g(i,{internalFormat:s.depthStencilTarget===o.DEPTH_RENDER_BUFFER?T.DEPTH_COMPONENT16:T.DEPTH_STENCIL,width:l,height:u}));const r=f===o.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(t,r,e.RENDERBUFFER,this._depthAttachment.glName);break}case o.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new g(i,{internalFormat:T.STENCIL_INDEX8,width:l,height:u})),e.framebufferRenderbuffer(t,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,this._stencilAttachment.glName);break;case o.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){i.capabilities.depthTexture||console.error(\"Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!\");const t={target:d.TEXTURE_2D,pixelFormat:_.DEPTH_STENCIL,dataType:a.UNSIGNED_INT_24_8,samplingMode:p.NEAREST,wrapMode:R.CLAMP_TO_EDGE,width:l,height:u};this._depthStencilTexture=new N(i,t)}this._framebufferTexture2D(this._depthStencilTexture.glName,e.DEPTH_STENCIL_ATTACHMENT,P(this._depthStencilTexture),t)}if(h()){e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error(\"Framebuffer is incomplete!\")}this._glName=r,this._initialized=!0}_framebufferTexture2D(t,e=c.COLOR_ATTACHMENT0,i=d.TEXTURE_2D,r=E.FRAMEBUFFER,h=0){this._context.gl.framebufferTexture2D(r,e,i,t,h)}_detachColorAttachment(t){h()&&console.warn(\"Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!\");const e=this._context.gl,i=this._colorAttachments.get(t);return b(i)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t)):this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(E.FRAMEBUFFER,t,e.RENDERBUFFER,null)),this._colorAttachments.delete(t),i}_disposeColorAttachments(){this._colorAttachments.forEach(((t,e)=>{this._detachColorAttachment(e),t.dispose()})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const e=this._desc.depthStencilTarget===o.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(E.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(E.FRAMEBUFFER,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(-1===x._MAX_COLOR_ATTACHMENTS){const t=this._context.capabilities.drawBuffers;if(t){const e=this._context.gl;x._MAX_COLOR_ATTACHMENTS=e.getParameter(t.MAX_COLOR_ATTACHMENTS)}else x._MAX_COLOR_ATTACHMENTS=1}const i=e-c.COLOR_ATTACHMENT0;i+1>x._MAX_COLOR_ATTACHMENTS&&t.getLogger(\"esri.views.webgl.FrameBufferObject\").error(\"esri.FrameBufferObject\",`illegal attachment point for color attachment: ${i+1}. Implementation supports up to ${x._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(t){return null!=t&&\"type\"in t&&\"texture\"===t.type}function D(t){return null!=t&&\"type\"in t&&\"renderbuffer\"===t.type}function C(t){return b(t)||null!=t&&\"pixelFormat\"in t}function S(t,e,i){return new N(t,{target:i,pixelFormat:_.RGBA,dataType:a.UNSIGNED_BYTE,samplingMode:p.NEAREST,wrapMode:R.CLAMP_TO_EDGE,width:e.width,height:e.height})}function U(t,e){t.target!==d.TEXTURE_2D&&t.target!==d.TEXTURE_CUBE_MAP&&console.error(\"Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!\"),void 0!==e.width&&e.width>=0&&void 0!==e.height&&e.height>=0?e.width===t.width&&e.height===t.height||console.error(\"Color attachment texture must match the framebuffer's!\"):(e.width=t.width,e.height=t.height)}function H(t,e){void 0!==e.width&&e.width>=0&&void 0!==e.height&&e.height>=0?e.width===t.width&&e.height===t.height||console.error(\"Renderbuffer dimensions must match the framebuffer's!\"):(e.width=t.width,e.height=t.height)}function P(t){return t.descriptor.target===d.TEXTURE_CUBE_MAP?d.TEXTURE_CUBE_MAP_POSITIVE_X:d.TEXTURE_2D}x._MAX_COLOR_ATTACHMENTS=-1;export{x as FramebufferObject};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.25/esri/copyright.txt for details.\n*/\nimport{nullifyNonNullableForDispose as e}from\"../../core/maybe.js\";import{ContextType as t}from\"./context-util.js\";import{ResourceType as r}from\"./enums.js\";class s{constructor(e,s){this._context=e,this._desc=s,this.type=\"renderbuffer\",this._context.instanceCounter.increment(r.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:n,height:o,internalFormat:h,multisampled:c}=s;if(c){if(this._context.type!==t.WEBGL2)throw new Error(\"Multisampled renderbuffers are not supported in WebGL1!\");i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,h,n,o)}else i.renderbufferStorage(i.RENDERBUFFER,h,n,o)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}resize(e,t){const r=this._desc;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const s=this._context.gl;if(this._context.bindRenderbuffer(this),r.multisampled){s.renderbufferStorageMultisample(s.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height)}else s.renderbufferStorage(s.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(r.Renderbuffer,this),this._context=e(this._context))}}export{s as Renderbuffer};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.25/esri/copyright.txt for details.\n*/\nimport\"../../core/has.js\";import{isNone as e}from\"../../core/maybe.js\";import{BufferType as r,CompressedTextureFormat as t,SizedPixelFormat as s,RenderbufferFormat as a,PixelFormat as c}from\"./enums.js\";function i(e){const r=e.gl;switch(r.getError()){case r.NO_ERROR:return null;case r.INVALID_ENUM:return\"An unacceptable value has been specified for an enumerated argument\";case r.INVALID_VALUE:return\"A numeric argument is out of range\";case r.INVALID_OPERATION:return\"The specified command is not allowed for the current state\";case r.INVALID_FRAMEBUFFER_OPERATION:return\"The currently bound framebuffer is not framebuffer complete\";case r.OUT_OF_MEMORY:return\"Not enough memory is left to execute the command\";case r.CONTEXT_LOST_WEBGL:return\"WebGL context is lost\"}return\"Unknown error\"}function n(e,r){return e.vertexBuffers[r].size/o(e.layout[r])}function o(e){return e[0].stride}function R(e,r,t,s,a=0){const c=e.gl,i=e.capabilities.instancing;e.bindBuffer(t);for(const n of s){const e=r.get(n.name);void 0===e&&console.error(`There is no location for vertex attribute '${n.name}' defined.`);const t=a*n.stride;if(n.count<=4)c.vertexAttribPointer(e,n.count,n.type,n.normalized,n.stride,n.offset+t),c.enableVertexAttribArray(e),n.divisor>0&&i&&i.vertexAttribDivisor(e,n.divisor);else if(9===n.count)for(let r=0;r<3;r++)c.vertexAttribPointer(e+r,3,n.type,n.normalized,n.stride,n.offset+12*r+t),c.enableVertexAttribArray(e+r),n.divisor>0&&i&&i.vertexAttribDivisor(e+r,n.divisor);else if(16===n.count)for(let r=0;r<4;r++)c.vertexAttribPointer(e+r,4,n.type,n.normalized,n.stride,n.offset+16*r+t),c.enableVertexAttribArray(e+r),n.divisor>0&&i&&i.vertexAttribDivisor(e+r,n.divisor);else console.error(\"Unsupported vertex attribute element count: \"+n.count)}}function E(e,t,s,a){const c=e.gl,i=e.capabilities.instancing;e.bindBuffer(s);for(const r of a){const e=t.get(r.name);if(r.count<=4)c.disableVertexAttribArray(e),r.divisor&&r.divisor>0&&i&&i.vertexAttribDivisor(e,0);else if(9===r.count)for(let t=0;t<3;t++)c.disableVertexAttribArray(e+t),r.divisor&&r.divisor>0&&i&&i.vertexAttribDivisor(e+t,0);else if(16===r.count)for(let t=0;t<4;t++)c.disableVertexAttribArray(e+t),r.divisor&&r.divisor>0&&i&&i.vertexAttribDivisor(e+t,0);else console.error(\"Unsupported vertex attribute element count: \"+r.count)}e.unbindBuffer(r.ARRAY_BUFFER)}function _(e){switch(e){case c.ALPHA:case c.LUMINANCE:case c.RED:case c.RED_INTEGER:case s.R8:case s.R8I:case s.R8UI:case s.R8_SNORM:case a.STENCIL_INDEX8:return 1;case c.LUMINANCE_ALPHA:case c.RG:case c.RG_INTEGER:case s.RGBA4:case s.R16F:case s.R16I:case s.R16UI:case s.RG8:case s.RG8I:case s.RG8UI:case s.RG8_SNORM:case s.RGB565:case s.RGB5_A1:case a.DEPTH_COMPONENT16:return 2;case c.DEPTH_COMPONENT:case c.RGB:case c.RGB_INTEGER:case s.RGB8:case s.RGB8I:case s.RGB8UI:case s.RGB8_SNORM:case s.SRGB8:case a.DEPTH_COMPONENT24:return 3;case c.DEPTH_STENCIL:case c.RGBA:case c.RGBA_INTEGER:case s.RGBA8:case s.R32F:case s.R11F_G11F_B10F:case s.RG16F:case s.R32I:case s.R32UI:case s.RG16I:case s.RG16UI:case s.RGBA8I:case s.RGBA8UI:case s.RGBA8_SNORM:case s.SRGB8_ALPHA8:case s.RGB9_E5:case s.RGB10_A2UI:case s.RGB10_A2:case a.DEPTH_STENCIL:case a.DEPTH_COMPONENT32F:case a.DEPTH24_STENCIL8:return 4;case a.DEPTH32F_STENCIL8:return 5;case s.RGB16F:case s.RGB16I:case s.RGB16UI:return 6;case s.RG32F:case s.RG32I:case s.RG32UI:case s.RGBA16F:case s.RGBA16I:case s.RGBA16UI:return 8;case s.RGB32F:case s.RGB32I:case s.RGB32UI:return 12;case s.RGBA32F:case s.RGBA32I:case s.RGBA32UI:return 16;case t.COMPRESSED_RGB_S3TC_DXT1_EXT:case t.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case t.COMPRESSED_RGBA_S3TC_DXT3_EXT:case t.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case t.COMPRESSED_R11_EAC:case t.COMPRESSED_SIGNED_R11_EAC:case t.COMPRESSED_RGB8_ETC2:case t.COMPRESSED_SRGB8_ETC2:case t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case t.COMPRESSED_RG11_EAC:case t.COMPRESSED_SIGNED_RG11_EAC:case t.COMPRESSED_RGBA8_ETC2_EAC:case t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function u(r){if(e(r))return 0;if(\"descriptor\"in r)return r.glName?u(r.descriptor):0;const t=r.internalFormat||\"pixelFormat\"in r&&r.pixelFormat;if(!t)return 0;const s=\"hasMipmap\"in r&&r.hasMipmap?1.3:1,a=r.width*r.height;return _(t)*a*s}export{R as bindVertexBufferLayout,_ as getBytesPerElementFormat,i as getErrorString,u as getGpuMemoryUsage,o as getStride,E as unbindVertexBufferLayout,n as vertexCount};\n"],"sourceRoot":""}