@@ -129,6 +129,83 @@ prior to Jan 1, 2021.
129129
130130## Library & Tooling Updates
131131
132+ ### [ Thunderdome]
133+
134+ [ Thunderdome] is a ~~ gladitorial~~ generational arena library inspired by
135+ [ generational-arena] , [ slotmap] , and [ slab] . It provides constant time
136+ insertion, lookup, and removal via small (8 byte) keys that stay 8 bytes when
137+ wrapped in ` Option<T> ` .
138+
139+ Data structures like Thunderdome's ` Arena ` store values and return keys that can
140+ be later used to access those values. These keys are stable across removals and
141+ have a generation counter to solve the [ ABA Problem] .
142+
143+ ``` rust
144+ let mut arena = Arena :: new ();
145+
146+ let foo = arena . insert (" Foo" );
147+ let bar = arena . insert (" Bar" );
148+
149+ assert_eq! (arena [foo ], " Foo" );
150+ assert_eq! (arena [bar ], " Bar" );
151+
152+ arena [bar ] = " Replaced" ;
153+ assert_eq! (arena [bar ], " Replaced" );
154+
155+ let foo_value = arena . remove (foo );
156+ assert_eq! (foo_value , Some (" Foo" ));
157+
158+ // The slot previously used by foo will be reused for baz.
159+ let baz = arena . insert (" Baz" );
160+ assert_eq! (arena [baz ], " Baz" );
161+
162+ // foo is no longer a valid key.
163+ assert_eq! (arena . get (foo ), None );
164+ ```
165+
166+ _ Discussions:
167+ [ twitter] ( https://twitter.com/LPGhatguy/status/1303375906493276160 ) _
168+
169+ [ Thunderdome ] : https://github.com/LPGhatguy/thunderdome
170+ [ generational-arena ] : https://crates.io/crates/generational-arena
171+ [ slotmap ] : https://crates.io/crates/slotmap
172+ [ slab ] : https://crates.io/crates/slab
173+ [ ABA Problem ] : https://en.wikipedia.org/wiki/ABA_problem
174+
175+ ### [ Crevice]
176+
177+ [ Crevice] is a library that helps define GLSL-compatible (std140) structs for
178+ use in uniform and storage buffers. It uses new ` const fn ` capabilities
179+ stabilized in [ Rust 1.46.0] to align types with explicitly zeroed padding.
180+
181+ Crevice depends heavily on [ mint] to support almost any Rust math library. It
182+ also contains helpers for safely sizing and writing buffers, making dynamic
183+ buffer layout a breeze.
184+
185+ ``` rust
186+ #[derive(AsStd140 )]
187+ struct MainUniform {
188+ orientation : mint :: ColumnMatrix3 <f32 >,
189+ position : mint :: Vector3 <f32 >,
190+ scale : f32 ,
191+ }
192+
193+ let value = MainUniform {
194+ orientation : cgmath :: Matrix3 :: identity (). into (),
195+ position : [1.0 , 2.0 , 3.0 ]. into (),
196+ scale : 4.0 ,
197+ };
198+
199+ upload_data_to_gpu (value . as_std140 (). as_bytes ());
200+ ```
201+
202+ _ Discussions:
203+ [ twitter] ( https://twitter.com/LPGhatguy/status/1308499131212599296 ) _
204+
205+ [ Crevice ] : https://github.com/LPGhatguy/crevice
206+ [ Rust 1.46.0 ] : https://blog.rust-lang.org/2020/08/27/Rust-1.46.0.html
207+ [ mint ] : https://github.com/kvark/mint
208+
132209### [ gfx-rs] and [ gfx-portability]
133210
134211![ gfx-rs logo] ( gfx-logo.png )
0 commit comments