All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.littlekt.graphics.VertexAttributeExt.kt Maven / Gradle / Ivy

There is a newer version: 0.11.0
Show newest version
package com.littlekt.graphics

import com.littlekt.graphics.webgpu.VertexFormat

/**
 * Calculates the stride of a list [VertexAttribute] by summing up the bytes of
 * [VertexAttribute.format].
 *
 * @see VertexFormat.bytes
 */
fun List.calculateStride(): Int = sumOf { it.format.bytes }

/**
 * Calculates the number of components in the list of [VertexAttribute] by summing up the components
 * of [VertexAttribute.format].
 *
 * @see VertexFormat.components
 */
fun List.calculateComponents(): Int = sumOf { it.format.components }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy