jalberse / shimmer

Physically based rendering in Rust
Apache License 2.0
33 stars 0 forks source link

Switch usize usages to u32 in data structures #69

Open jalberse opened 6 months ago

jalberse commented 6 months ago

There are a number of data structures (such as Tris indexing into the mesh) which store a usize. This takes up 64 bits on a x86_64 machine. That's more memory than we want, since we won't have meshes large enough to need the extra bits.

Go through the codebase and find instances like this to avoid too-large data structures on 64 bit machines.

jalberse commented 6 months ago

I misremembered - the Triangles are actually storing an Arc to the shared mesh. Issue #81 discusses reducing that memory consumption.

This can still be done, though - TriangleMeshes are storing lists of usize for example, which can be u32 instead.