diff options
Diffstat (limited to 'wgpu/src/primitive.rs')
-rw-r--r-- | wgpu/src/primitive.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/wgpu/src/primitive.rs b/wgpu/src/primitive.rs index 823b4b72..46d9e624 100644 --- a/wgpu/src/primitive.rs +++ b/wgpu/src/primitive.rs @@ -78,7 +78,18 @@ pub enum Primitive { origin: Point, /// The vertex and index buffers of the mesh - buffers: Arc<triangle::Mesh2D>, + buffers: triangle::Mesh2D, + }, + /// A cached primitive. + /// + /// This can be useful if you are implementing a widget where primitive + /// generation is expensive. + Cached { + /// The origin of the coordinate system of the cached primitives + origin: Point, + + /// The cached primitive + cache: Arc<Primitive>, }, } |