/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{BufferCache as e}from"./BufferCache.js";import{getStrideForDataType as r}from"./IndexLayout.js";import{BufferObject as t}from"../../../../webgl/BufferObject.js";import{DataType as s}from"../../../../webgl/enums.js";class c{constructor(r){this._cache=new e(r.newCache,e=>{const c=t.createIndex(r,35044);return c.setSize(e,s.UNSIGNED_BYTE),c},"IndexBufferCache")}dispose(){this._cache.dispose()}newIndexBuffer(e,t){const s=r(t)*e,c=this._cache.newBuffer(s);return c.setIndexType(t),c}deleteIndexBuffer(e){this._cache.deleteBuffer(e)}}export{c as IndexBufferCache};
