File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 1
- pub trait WasmPadding { }
2
-
3
- /// No WASM padding
4
- impl WasmPadding for ( ) { }
5
-
6
- /// Single float WASM padding
7
- impl WasmPadding for f32 { }
1
+ #[ repr( C ) ]
2
+ pub struct Globals {
3
+ // The time since startup in seconds
4
+ // Wraps to 0 after 1 hour.
5
+ pub time : f32 ,
6
+ // The delta time since the previous frame in seconds
7
+ pub delta_time : f32 ,
8
+ // Frame count since the start of the app.
9
+ // It wraps to zero when it reaches the maximum value of a u32.
10
+ pub frame_count : u32 ,
11
+ }
8
12
9
13
#[ repr( C ) ]
10
- pub struct Globals < P : WasmPadding = ( ) > {
14
+ pub struct GlobalsWasm {
11
15
// The time since startup in seconds
12
16
// Wraps to 0 after 1 hour.
13
17
pub time : f32 ,
@@ -18,5 +22,5 @@ pub struct Globals<P: WasmPadding = ()> {
18
22
pub frame_count : u32 ,
19
23
20
24
// WebGL2 structs must be 16 byte aligned.
21
- _wasm_padding : P ,
25
+ _wasm_padding : f32 ,
22
26
}
You can’t perform that action at this time.
0 commit comments