/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{glsl as t}from"../../shaderModules/glsl.js";import{pathVertexInfoSourceIndexShift as e,pathVertexInfoSourceIndexMask as n,pathVertexInfoSubdivisionShift as a,pathVertexInfoSubdivisionMask as o,pathVertexInfoTypeShift as i,pathVertexInfoTypeMask as d,pathVertexInfoCapSideShift as s,pathVertexInfoCapSideMask as r}from"../../../lib/PathVertexInfo.js";function p(p){const{attributes:f,vertex:h}=p;f.add("pathVertexInfo","uint"),h.constants.add("pathVertexInfoSourceIndexShift","uint",e),h.constants.add("pathVertexInfoSourceIndexMask","uint",n),h.constants.add("pathVertexInfoSubdivisionShift","uint",a),h.constants.add("pathVertexInfoSubdivisionMask","uint",o),h.constants.add("pathVertexInfoTypeShift","uint",i),h.constants.add("pathVertexInfoTypeMask","uint",d),h.constants.add("pathVertexInfoCapSideShift","uint",s),h.constants.add("pathVertexInfoCapSideMask","uint",r),h.constants.add("pathVertexCapSideEnd","uint",1),h.code.add(t`struct PathVertexInfo {
uint sourceIndex;
float subdivision;
uint type;
bool isEnd;
};
PathVertexInfo decodePathVertexInfo() {
uint sourceIndex = (pathVertexInfo >> pathVertexInfoSourceIndexShift) & pathVertexInfoSourceIndexMask;
uint subdivision = (pathVertexInfo >> pathVertexInfoSubdivisionShift) & pathVertexInfoSubdivisionMask;
uint type = (pathVertexInfo >> pathVertexInfoTypeShift) & pathVertexInfoTypeMask;
uint capSide = (pathVertexInfo >> pathVertexInfoCapSideShift) & pathVertexInfoCapSideMask;
return PathVertexInfo(
sourceIndex,
float(subdivision),
type,
capSide == pathVertexCapSideEnd
);
}`)}export{p as PathVertexInfo};
