diff options
| author | HampusM <hampus@hampusmat.com> | 2026-04-17 17:25:31 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-04-17 17:25:31 +0200 |
| commit | 92a432415eaeb09aa5ad16304bcbba33e11ee222 (patch) | |
| tree | 092618b3e9dadc9c81c38b00d0ea5ddf4e4389c1 /engine/src/renderer.rs | |
| parent | 50fa4f2527bf86ff4864e966b7c3fbed50fab527 (diff) | |
Diffstat (limited to 'engine/src/renderer.rs')
| -rw-r--r-- | engine/src/renderer.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/engine/src/renderer.rs b/engine/src/renderer.rs index 725f208..d7ce02e 100644 --- a/engine/src/renderer.rs +++ b/engine/src/renderer.rs @@ -177,6 +177,8 @@ pub enum Command /// If `obj_id` is [`ObjectId::Asset`], this mesh data will be used instead of /// the mesh data stored in the asset. mesh: Option<Mesh>, + + usage: MeshUsage, }, DrawMesh(ObjectId), SetPolygonModeConfig(PolygonModeConfig), @@ -191,6 +193,19 @@ bitflags! { } } +#[derive(Debug, Clone, Copy)] +pub enum MeshUsage +{ + /// The mesh data is set only once and used by the GPU at most a few times. + Stream, + + /// The mesh data is set only once and used many times. + Static, + + /// The mesh data is changed a lot and used many times. + Dynamic, +} + /// Renderer command FIFO queue. /// /// This component is present in renderer context entities. @@ -428,6 +443,7 @@ pub fn add_main_render_passes( render_pass.commands.push(Command::CreateMesh { obj_id: ObjectId::Asset(mesh_asset.id()), mesh: None, + usage: MeshUsage::Static, }); } |
