File tree 1 file changed +4
-3
lines changed
crates/bevy_render/src/render_resource 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ impl<T: GpuArrayBufferable> BatchedUniformBuffer<T> {
91
91
self . uniforms . push ( self . temp . clone ( ) ) ;
92
92
93
93
self . current_offset +=
94
- round_up ( self . temp . size ( ) . get ( ) , self . dynamic_offset_alignment as u64 ) as u32 ;
94
+ align_to_next ( self . temp . size ( ) . get ( ) , self . dynamic_offset_alignment as u64 ) as u32 ;
95
95
96
96
self . temp . 0 . clear ( ) ;
97
97
}
@@ -115,8 +115,9 @@ impl<T: GpuArrayBufferable> BatchedUniformBuffer<T> {
115
115
}
116
116
117
117
#[ inline]
118
- fn round_up ( v : u64 , a : u64 ) -> u64 {
119
- ( ( v + a - 1 ) / a) * a
118
+ fn align_to_next ( value : u64 , alignment : u64 ) -> u64 {
119
+ debug_assert ! ( alignment & ( alignment - 1 ) == 0 ) ;
120
+ ( ( value - 1 ) | ( alignment - 1 ) ) + 1
120
121
}
121
122
122
123
// ----------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments