Skip to content

Commit 5414538

Browse files
Apply suggestion from @cwfitzgerald
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
1 parent 7f5839a commit 5414538

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wgpu-hal/src/dx12/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,8 +1599,8 @@ impl MeshShaderPipelineStateStream {
15991599

16001600
// Align the data
16011601
let obj_align = align_of_val(&$data);
1602-
let data_padding = (obj_align - (bytes.len() % obj_align)) % obj_align;
1603-
bytes.extend(core::iter::repeat(0).take(data_padding));
1602+
let data_start = bytes.len().next_multiple_of(obj_align);
1603+
bytes.resize(data_start, 0);
16041604

16051605
// Append the data itself
16061606
#[allow(clippy::ptr_as_ptr, trivial_casts)]

0 commit comments

Comments
 (0)