kornelski / imgref

A trivial Rust struct for interchange of pixel buffers with width, height & stride
https://lib.rs/crates/imgref
Apache License 2.0
59 stars 5 forks source link

rayon #18

Closed owenthewizard closed 2 years ago

owenthewizard commented 2 years ago

Would it be possible to add rayon support? Right now par_bridge can't be used because the iterators aren't Send.

kornelski commented 2 years ago

You should be able to use .rows() iterator. Splitting parallelism per pixel is going to have prohibitively large overhead.

owenthewizard commented 2 years ago

Big brain; thanks. 😣

LoganDark commented 2 years ago

You should be able to use .rows() iterator. Splitting parallelism per pixel is going to have prohibitively large overhead.

Worked for my path tracer. Rayon is designed to split extremely small workloads. (But only if it knows the size up-front.)