Transcoder

Converts vertex attribute data into tightly packed floats: useful for 3-component formats not every backend supports (the Vulkan minspec includes float3 but not short3).

val transcode = Transcoder(Transcoder.Config(ComponentType.BYTE, normalized = true, componentCount = 3))
transcode(output, input, count)

Signed normalized data follows Vulkan and OpenGL ES 3.0+: a byte of -127 maps exactly to -1.

Constructors

Link copied to clipboard
constructor(config: Transcoder.Config)

Types

Link copied to clipboard
class Config(var componentType: ComponentType, var normalized: Boolean, var componentCount: Int, var inputStrideBytes: Int = 0)

The format of all input data.

Properties

Link copied to clipboard

The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.

Functions

Link copied to clipboard
open override fun close()

Same as destroy; lets this be used with use { } and try-with-resources.

Link copied to clipboard
fun destroy()

Frees the transcoder.

Link copied to clipboard
operator fun invoke(target: FloatArray?, source: ByteArray, count: Int): Int

Converts up to count items (e.g. float3 values, not bytes) of source into packed floats in target, or only measures them when target is null.