toMeshDraw

@JvmName(name = "create")
fun MeshData.toMeshDraw(pipeline: RenderPipeline, vertexUploader: MeshDraw.VertexUploader = DefaultUploader, indexUploader: MeshDraw.IndexUploader = DefaultUploader): MeshDraw

Sort quads (if needed) and upload or describe the buffers needed by MeshData.

If MeshData.indexBuffer returns null, the resulting MeshDraw resolves vanilla's shared sequential index buffer lazily via RenderSystem.getSequentialBuffer when it is drawn.

This function doesn't close the MeshData.

vertexUploader/indexUploader decide the storage strategy: the default companion uploader uses shared dynamic per-frame buffers, while custom uploaders can use dedicated static buffers or staged upload paths.

Return

The uploaded data. The lifecycle is handled by backend buffer storage.