/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{DataType as e}from"../../../webgl/enums.js";import{VertexElementDescriptor as r}from"../../../webgl/VertexElementDescriptor.js";function t(e,t=0){const o=e.stride;return Array.from(e.fields.keys()).map(s=>{const u=e.fields.get(s),c=u.constructor.ElementCount,i=n(u.constructor.ElementType),a=u.offset,f=u.optional?.glNormalized??!1,l=u.optional?.integer??!1;return new r(s,c,i,a,o,f,t,l)})}function n(r){switch(r){case"u8":return e.UNSIGNED_BYTE;case"u16":return e.UNSIGNED_SHORT;case"u32":return e.UNSIGNED_INT;case"i8":return e.BYTE;case"i16":return e.SHORT;case"i32":return e.INT;case"f16":return e.HALF_FLOAT;case"f32":return e.FLOAT;default:throw new Error("BufferType not supported in WebGL")}}export{t as glLayout};
