shuffel for every frame
This commit is contained in:
parent
1e93198c31
commit
28d5d6db14
1 changed files with 3 additions and 2 deletions
|
|
@ -229,12 +229,13 @@ fn packer_loop(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regenerate the permutation when the frame size changes.
|
// Rebuild index array only when frame size changes; otherwise
|
||||||
|
// re-shuffle the existing permutation in place.
|
||||||
if frame.len() != last_frame_len {
|
if frame.len() != last_frame_len {
|
||||||
permutation = (0..frame.len()).collect();
|
permutation = (0..frame.len()).collect();
|
||||||
fisher_yates_shuffle(&mut permutation, &mut rng);
|
|
||||||
last_frame_len = frame.len();
|
last_frame_len = frame.len();
|
||||||
}
|
}
|
||||||
|
fisher_yates_shuffle(&mut permutation, &mut rng);
|
||||||
|
|
||||||
// Walk the permutation, packing pixels into packets.
|
// Walk the permutation, packing pixels into packets.
|
||||||
let mut buf = grab_buf(&queue);
|
let mut buf = grab_buf(&queue);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue