nak: add all identical values in one step

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
This commit is contained in:
Eric Engestrom 2025-10-04 17:14:04 +02:00
parent ce04b8a578
commit 23ae567ae6

View file

@ -432,7 +432,7 @@ pub fn test_foldable_op_with(
// to give us 2500 iterations.
let invocations = src_comps * src_comps * 100;
let mut data = Vec::new();
let mut data = Vec::with_capacity(invocations * (dst_comps + src_comps));
for _ in 0..invocations {
for (i, src) in op.srcs_as_slice().iter().enumerate() {
let SrcRef::SSA(vec) = &src.src_ref else {
@ -449,9 +449,7 @@ pub fn test_foldable_op_with(
}
}
}
for _ in 0..dst_comps {
data.push(0_u32);
}
data.extend(std::iter::repeat_n(0_u32, dst_comps));
}
debug_assert!(data.len() == invocations * comps);