GPU: add support for N-many input images and not just exactly one#4166
GPU: add support for N-many input images and not just exactly one#4166Firestar99 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for multiple input images within the PerPixelAdjust shader runtime and macro. It updates the runtime to process a slice of texture lists, implements dynamic binding allocation using a new Counter utility, and synchronizes dispatch counts based on the shortest input list. Feedback focused on performance improvements, specifically recommending the use of Vec::with_capacity for the entries vectors during pipeline creation and within the dispatch loop to minimize re-allocations.
| }, | ||
| count: None, | ||
| let mut binding_alloc = Counter::default(); | ||
| let mut entries = Vec::new(); |
There was a problem hiding this comment.
| let out = (0..dispatch_cnt) | ||
| .map(|dispatch_id| { | ||
| let mut binding_alloc = Counter::default(); | ||
| let mut entries = Vec::new(); |
There was a problem hiding this comment.
In the dispatch loop, entries is allocated for every image in the list. Pre-allocating with with_capacity based on the number of input images and the uniform buffer presence will improve performance, especially when processing long lists of images.
| let mut entries = Vec::new(); | |
| let mut entries = Vec::with_capacity(self.input_images + self.has_uniform as usize); |
|
The mandelbrot node computes only the which is going to be visible in the viewport and at the correct resolution, that is what that math is for |
I'm sitting in the Eurostar from rustweek to Paris, running down the track at 300km/h, with a 30min delay of course... and finally found some time for something I wanted to add right after GSoC but never came around to it :D
GPU blend nodes

blend GPUnode with 2 inputs