import { ParticleAttributeType } from "./ParticleAttributeType.js";

/**
 *
 * @param {ParticleAttributeType} type
 */
export function itemSizeFromAttributeType(type) {
    switch (type) {
        case ParticleAttributeType.Scalar:
            return 1;
        case ParticleAttributeType.Vector2:
            return 2;
        case ParticleAttributeType.Vector3:
            return 3;
        case ParticleAttributeType.Vector4:
            return 4;
        default:
            throw new Error(`Unsupported attribute type: ${type}`);
    }
}
