Commit 89c5239e02

89c5239e0248e12f92dd6c0718df149cb2b35f20

parent: 216be23aa7

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-20 08:43 UTC

Say that render waits for the previous frame

Ref #6

Layout: unified · split

Packages/FoldKit/Sources/Renderer/PaperRenderer.swift +2 −1
@@ -81,7 +81,8 @@ public final class PaperRenderer {
81 81
82 /// Draws `mesh` with its vertices at `positions` into `target`, cleared to `background`. 82 /// Draws `mesh` with its vertices at `positions` into `target`, cleared to `background`.
83 /// Faces in no cluster are not drawn. `faceColours`, when given, draws FOLD face i in 83 /// Faces in no cluster are not drawn. `faceColours`, when given, draws FOLD face i in
84 /// `faceColours[i]`, unlit, on both sides. Commits to `commandQueue` without waiting. 84 /// `faceColours[i]`, unlit, on both sides. Waits for the previous frame to finish, since it
85 /// reuses that frame's vertex buffer, then commits to `commandQueue` without waiting for this one.
85 public func render(positions: [SIMD3<Double>], mesh: RenderMesh, clusters: [CoplanarCluster], camera: Camera, 86 public func render(positions: [SIMD3<Double>], mesh: RenderMesh, clusters: [CoplanarCluster], camera: Camera,
86 faceColours: [SIMD4<Float>]? = nil, into target: MTLTexture) throws { 87 faceColours: [SIMD4<Float>]? = nil, into target: MTLTexture) throws {
87 let (vertices, ranges) = groupedVertices(positions: positions, mesh: mesh) 88 let (vertices, ranges) = groupedVertices(positions: positions, mesh: mesh)