@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 765 B
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{DataType as e}from"../../../webgl/enums.js";import{VertexElementDescriptor as r}from"../../../webgl/VertexElementDescriptor.js";function t(e,t=0){const n=e.stride;return Array.from(e.fields.keys()).map((s=>{const i=e.fields.get(s),f=i.constructor.ElementCount,u=o(i.constructor.ElementType),c=i.offset,m=i.optional?.glNormalized??!1;return new r(s,f,u,c,n,m,t)}))}function o(e){const r=n[e];if(r)return r;throw new Error("BufferType not supported in WebGL")}const n={u8:e.UNSIGNED_BYTE,u16:e.UNSIGNED_SHORT,u32:e.UNSIGNED_INT,i8:e.BYTE,i16:e.SHORT,i32:e.INT,f16:e.HALF_FLOAT,f32:e.FLOAT};export{t as glLayout};