Skip to content

Reduce allocs - #345

Draft
jdahlstrom wants to merge 70 commits into
mainfrom
reduce-allocs
Draft

jdahlstrom wants to merge 70 commits into
mainfrom
reduce-allocs

Conversation

@jdahlstrom

Copy link
Copy Markdown
Owner

No description provided.

Gives an alterative way to construct a Batch,
no good reason to keep them private.
Moves a point towards another point by an offset without overshooting.
These are needed often enough that adding them manually is a pain.
Implements airplane-like control of the pitch (elevation), yaw (bearing),
and roll (bank) angles of the camera. These angles are also known to as
Tait–Bryan angles.
* Color::clamp(): like in Vec and Point
* VecN::normalize_or_zero(): don't panic, return zero
* MatN::origin(): return the translation vector as a point
* Batch::append(): append the geometry of a batch to another
* Tri::centroid(): return the center point of a triangle
Supports linear, radial, and conical gradients with arbitrary color maps.
The core module started getting really crowded.
Added a glob re-export to keep all existing paths valid.
Add proper unit tests for linear and translate/origin
Revamp tests to ensure that the methods are approximate inverses.
* No square roots needed
* Division only when needed
* Early exits in unlikely cases only pessimize
* Add some #[inline]s and #[inline(never)]s
* Use unit-tagged matrix and vector types internally
* Avoid formatting machinery when not needed
* Polymorphize Lathe::build_with
Can be used to reduce generic bloat and needless Vector wrapping.
Require that (a, b, c) passed to Plane::new is unit length.
Removes the need for normalizing on the fly and the abc() helper.
* Line-line
* Ray-line
* Ray-edge
* Edge-edge

These are all in the same "family", just different constraints.
This is a better match and allows making various Target impls generic over
any pixel format. The custom Framebuf type for SDL2 could be removed.
* Similar to SDL2 frontend
* Removes the unsafe block casting [u32] to [u8]
* Fixes component order from BGRA to RGBA, oops.
Change temporary Vecs in clipper to simple custom static vector type.
Test using bumpalo as an allocator
@jdahlstrom
jdahlstrom marked this pull request as draft January 17, 2026 00:02
Base automatically changed from dev to master May 14, 2026 08:48

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant