Let's say I'm path tracing a fairly complex scene, which results in a low framerate, but I would also like to change the rendering parameters using an immediate mode GUI that I'd like to be responsive and so should render at a minimum of 60fps, on the same window. After searching online I've gathered that it's not really possible to interrupt a GPU in the middle of a draw call execution; so I'm guessing the only way to render interactive and non-interactive content at the same time is to perform the rendering of the interactive part on the integrated GPU or in software. But what if the UI is layered on top of the path traced image with some transparency applied; in that case I would need to share a texture across different contexts. Do all graphics APIs provide a way to do that? What would be the best approach for this sort of thing?
The only way I can see that working is by doing double buffering on the slow thing. That way you can do the rendering in chunks and then inbetween at some copy the latest finished image and then render the gui on top and show that on screen.
That will work with all apis.
You'll need some way to meter out the work on the slow thing so you can insert the gui rendering.
I see. That sounds like a robust approach. In the case of a path tracer in fragment/compute shader, I could subdivide the fullscreen quad into multiple smaller quads and then draw the GUI in between. Will the subdivision in chunks slow down the rendering in any way?