Replies: 2 comments 4 replies
-
You might be able to work something out with using more than 1 Adapter, and copying the result back to the CPU to send to the other adapter to render. Not sure though, I've never tried more than 1 adapter. But in general what you want is "multi queue" or "async compute", which wgpu does not support, and is unlikely to be supported for a long while given the complexity involved. |
Beta Was this translation helpful? Give feedback.
-
My understanding is that even if It's up to you to divide your work into small enough chunks that no chunk takes too long (while still keeping them large enough to fully occupy the SIMD-parallel hardware). Unfortunately, I don't know what type of subdivision is necessary — I haven't studied this problem in any detail, beyond entire frames taking too long — but you might need just separate |
Beta Was this translation helpful? Give feedback.
-
I'm working on an interactive Mandelbrot fractal explorer / visualizer. I use
eframe
to render GUI frames using its wgpu backend.Computing the fractal for each pixel is very compute intensive. I'm interested in offloading that computation to the GPU.
The computation needs to happen "in the background," i.e., not block the main UI loop. When the fractal is zoomed in very deeply, these computations can take multiple seconds to complete.
Having read up on the documentation for
Queue
, some things are not clear to me about how submitted work is executed:1. Is each distinct
submit()
call to aQueue
executed serially on the GPU?In other words, does one long submission block subsequent submissions from executing?
Let's say my GUI thread submits work to render a frame, and then my compute thread submits work to compute the fractal. If the compute submission takes a long time, does that necessarily delay the next GUI frame? Or can the work for the next GUI frame execute and finish while the compute submission is still going?
2. Is each distinct
CommandBuffer
in asubmit([buffers])
call executed serially on the GPU?In other words, can I expect the GPU to parallelize work if I submit that work in multiple command buffers? And if I submit the work in fewer command buffers, should I expect less parallelism?
Reason I ask is because I am breaking the screen into chunks and computing the fractal data separately per chunk. I want to know that the GPU will process as many chunks in parallel as it can, even if they're split into separate
ComputePass
es.I see some discussion of this in #5074 (comment), but it seems the original poster was left hanging on an answer.
Beta Was this translation helpful? Give feedback.
All reactions