-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate glam source code offline instead of with macros (#294)
Replaces macro codegen with code generated offline by a code generator tool. The intention is to improve source code readability for users. * Move implementation from core module to codegen templates. All scalar, sse2 and wasm32 code is inside the codegen templates now, the core module is removed. * Making const creation functions, deprecating const macros. * Bump minimum Rust version to 1.58.1 and the 2021 edition Needed for const pointer dereferences and assert in a const eval context.
- Loading branch information
1 parent
88e4538
commit 58285f7
Showing
155 changed files
with
56,813 additions
and
22,528 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[sse2_math] | ||
features = "approx bytemuck mint rand rkyv serde debug-glam-assert" | ||
exclude-files = ["src/transform.rs", "src/core/wasm32/*", "src/swizzles/vec3a_impl_wasm32.rs", "src/swizzles/vec4_impl_wasm32.rs", "benches/*", "tests/support/mod.rs"] | ||
exclude-files = ["codegen/*", "src/wasm32.rs", "src/bool/wasm32/*", "src/f32/wasm32/*", "src/swizzles/vec3a_impl_wasm32.rs", "src/swizzles/vec4_impl_wasm32.rs", "benches/*", "tests/support.rs"] | ||
|
||
[scalar_math] | ||
features = "scalar-math approx bytemuck mint rand rkyv serde debug-glam-assert" | ||
exclude-files = ["src/transform.rs", "src/core/wasm32/*", "src/swizzles/vec3a_impl_wasm32.rs", "src/swizzles/vec4_impl_wasm32.rs", "benches/*", "tests/support/mod.rs"] | ||
exclude-files = ["codegen/*", "src/wasm32.rs", "src/bool/wasm32/*", "src/f32/wasm32/*", "src/swizzles/vec3a_impl_wasm32.rs", "src/swizzles/vec4_impl_wasm32.rs", "benches/*", "tests/support.rs"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
[package] | ||
name = "glam" | ||
version = "0.20.5" # remember to update html_root_url | ||
edition = "2018" | ||
edition = "2021" | ||
authors = ["Cameron Hart <[email protected]>"] | ||
description = "A simple and fast 3D math library for games and graphics" | ||
repository = "https://github.com/bitshifter/glam-rs" | ||
readme = "README.md" | ||
license = "MIT OR Apache-2.0" | ||
keywords = ["gamedev", "math", "matrix", "vector", "quaternion"] | ||
categories = ["game-engines", "no-std"] | ||
rust-version = "1.58.1" | ||
|
||
[badges] | ||
maintenance = { status = "actively-developed" } | ||
|
@@ -27,9 +28,6 @@ glam-assert = [] | |
# this is primarily for testing the fallback implementation | ||
scalar-math = [] | ||
|
||
# deprecated and will move to a separate crate | ||
transform-types = [] | ||
|
||
# libm is required when building no_std | ||
libm = ["num-traits/libm"] | ||
|
||
|
@@ -95,11 +93,6 @@ harness = false | |
name = "quat" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "transform" | ||
harness = false | ||
required-features = ["transform-types"] | ||
|
||
[[bench]] | ||
name = "vec2" | ||
harness = false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
msrv = "1.51" | ||
msrv = "1.58" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "codegen" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
anyhow = { version = "1", default-features = false } | ||
clap = { version = "3", default-features = false, features = ["cargo", "std"] } | ||
git2 = { version = "0.14", default-features = false } | ||
globset = { version = "0.4", default-features = false } | ||
rustfmt-wrapper = { version = "0.1" } | ||
serde = { version = "1.0", default-features = false, features = ["std"] } | ||
serde_json = { version = "1.0", default-features = false, features = ["std"] } | ||
tera = { version = "1", default-features = false } |
Oops, something went wrong.